title: Enable BroadcastReceiver of other application using PackageManager.setComponentEnabledSetting()
body: <p>I want to start the BroadcastReceiver of other application installed on my android device from my app. Here is the code</p>
  
  <pre><code>ComponentName componentName  = new ComponentName("com.example.myapp","com.example.myapp.MyBroadcastReceiver");
  pkgManager.setComponentEnabledSetting(componentName,
                           PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                           PackageManager.DONT_KILL_APP);
  </code></pre>
  
  <p>"com.example.myapp" is the package name of the other application which contains "MyBroadcastReceiver"</p>
  
  <p>I referred answers given in the post <a href="https://stackoverflow.com/questions/8445881/android-packagemanager-enable-any-application">Android PackageManager enable any application</a> and <a href="https://stackoverflow.com/questions/2052589/android-cant-enable-broadcastreceiver">Android - can&#39;t enable BroadcastReceiver</a> but none of them seems to be working. The application continues throwing the permission denial SecurityException. Given is the logcat</p>
  
  <pre><code>05-24 11:37:38.382: E/AndroidRuntime(8746): java.lang.SecurityException: Permission Denial: attempt to change component state from pid=8746, uid=10042, package uid=10041
  </code></pre>