android PackageManager.setApplicationEnabledSetting()

来源:互联网 发布:查看windows系统版本 编辑:程序博客网 时间:2024/06/14 00:04
/**     * Flag for {@link #setApplicationEnabledSetting(String, int, int)}     * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This     * component or application is in its default enabled state (as specified     * in its manifest).     */    public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0;    /**     * Flag for {@link #setApplicationEnabledSetting(String, int, int)}     * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This     * component or application has been explictily enabled, regardless of     * what it has specified in its manifest.     */    public static final int COMPONENT_ENABLED_STATE_ENABLED = 1;    /**     * Flag for {@link #setApplicationEnabledSetting(String, int, int)}     * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This     * component or application has been explicitly disabled, regardless of     * what it has specified in its manifest.     */    public static final int COMPONENT_ENABLED_STATE_DISABLED = 2;    /**     * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The     * user has explicitly disabled the application, regardless of what it has     * specified in its manifest.  Because this is due to the user's request,     * they may re-enable it if desired through the appropriate system UI.  This     * option currently <strong>can not</strong> be used with     * {@link #setComponentEnabledSetting(ComponentName, int, int)}.     */    public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3;//以上几个常量可以用于使用APKgetPackageManager().setApplicationEnabledSetting("com.android.vending", PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0);//若在此方法之前已经把com.android.vending DISABLE, 那么,这句代码呢,就是重新使com.android.vending ENABLED//用于隐藏APK很是实用.

 

 

 

 

0 0
原创粉丝点击