2014-06-13 112 views

回答

0

試試下面的代碼: -

PackageManager pm = Re_editActivity.this.getPackageManager(); 
ComponentName componentName = new ComponentName(currentActivity.this, name_of_your_receiver.class); 
pm.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 
         PackageManager.DONT_KILL_APP); 
Toast.makeText(getApplicationContext(), "cancelled", Toast.LENGTH_LONG).show(); 

更多信息請參見下面的鏈接: -

http://www.javacodegeeks.com/2012/08/android-broadcast-receiver-enable-and.html