title: How can i disable any android app such that it cannot be opened until i change/press some button in app?
body: <p>I am trying to build a parental control app. So now i want to disable or lock app (like Whatsapp, Facebook, etc). I have tried using <code>PackageManager.setComponentEnabledSetting()</code>. But it is throwing <code>java.lang.SercurityException</code>.</p>
  
  <p><strong>So how can I make a parental control app such that I can disable any app I want without root</strong>.</p>
  
  <p>my code is</p>
  
  <pre><code> pm.setComponentEnabledSetting(new ComponentName(temp.activityInfo.packageName,
                          temp.activityInfo.name+".class"),
                          PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                          PackageManager.DONT_KILL_APP);
  </code></pre>
  
  <p>my error was this</p>
  
  <blockquote>
    <p>java.lang.SecurityException: Permission Denial: attempt to change component state from pid=11537, uid=10067, package uid=10029</p>
  </blockquote>