首页 > 解决方案 > 为什么我在 Android 开发者中找不到“ACTION_REQUEST_SHUTDOWN”?

问题描述

上个月在Android Developers Doc中发现了这个问题,但是今天找不到了。

有什么想法可以帮助我吗?谢谢!

标签: android

解决方案


它可能会从 Docs 中删除,因为这是一个隐藏常量,至少在 Android 9 上是这样:

http://androidxref.com/9.0.0_r3/xref/frameworks/base/core/java/android/content/Intent.java#2638

/**
     * Activity Action:  Start this activity to request system shutdown.
     * The optional boolean extra field {@link #EXTRA_KEY_CONFIRM} can be set to true
     * to request confirmation from the user before shutting down. The optional boolean
     * extra field {@link #EXTRA_USER_REQUESTED_SHUTDOWN} can be set to true to
     * indicate that the shutdown is requested by the user.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     *
     * {@hide}
     */
    public static final String ACTION_REQUEST_SHUTDOWN
            = "com.android.internal.intent.action.REQUEST_SHUTDOWN";

推荐阅读