首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Android动态封锁mainfest中的receiver

2012-07-01 
Android动态关闭mainfest中的receiverComponentName receiver new ComponentName(MainActivity.this,Boo

Android动态关闭mainfest中的receiver

ComponentName receiver = new ComponentName(MainActivity.this,BootReceiver.class);PackageManager pm = MainActivity.this.getPackageManager();pm.setComponentEnabledSetting(receiver,PackageManager.COMPONENT_ENABLED_STATE_ENABLED,PackageManager.DONT_KILL_APP);

?状态有三个

不可用状态:COMPONENT_ENABLED_STATE_DISABLED

可用状态:COMPONENT_ENABLED_STATE_ENABLED

默认状态:COMPONENT_ENABLED_STATE_DEFAULT

热点排行