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

你可能感兴趣的:(android)