android setApplicationEnabledSetting / setComponentEnabledSetting
https://developer.android.com/reference/android/content/pm/PackageManager.html#setApplicationEnabledSetting(java.lang.String, int, int)
setApplicationEnabledSetting
setApplicationEnabledSettingAdded in API level 1public abstract void setApplicationEnabledSetting (String packageName,
int newState,
int flags)
Set the enabled setting for an application This setting will override any enabled state which may have been set by the application in its manifest. It also overrides the enabled state set in the manifest for any of the application’s components.
packageName | String: The package name of the application to enable This value must never be null. |
---|---|
newState | int: The new enabled state for the application. Value is COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_ENABLED, COMPONENT_ENABLED_STATE_DISABLED, COMPONENT_ENABLED_STATE_DISABLED_USER, or COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED |
flags | int: Optional behavior flags. Value is either 0 or DONT_KILL_APP |
setComponentEnabledSetting
public abstract void setComponentEnabledSetting (ComponentName componentName,
int newState,
int flags)
Set the enabled setting for a package component (activity, receiver, service, provider). This setting will override any enabled state which may have been set by the component in its manifest.
componentName | ComponentName: The component to enable This value must never be null. |
---|---|
newState | int: The new enabled state for the component. Value is COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_ENABLED, COMPONENT_ENABLED_STATE_DISABLED, COMPONENT_ENABLED_STATE_DISABLED_USER, or COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED |
flags | int: Optional behavior flags. Value is either 0 or DONT_KILL_APP |
developer.android.com
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer