title: How to create an app lock for email in android
body: <p>I am creating a lock application in android which fetches all the present application installed in the android device and creates a option for the user to set a lock over whichever application he wishes to lock.</p>
  
  <p>When that application is clicked first the lock app asks for the unlock password if password is correct it opens the application.</p>
  
  <p>I am facing these problems while doing this:</p>
  
  <p>1> If the password entered is wrong then the application shouldn't open, or start at all, i understood that killing others app is not basically possible so can i do anything like the </p>
  
  <p>a> app doesn't start at all, or </p>
  
  <p>b> if that is also not possible then can i make it to background at least, </p>
  
  <p>I'm not able to do any of these procedures</p>
  
  <p>2> if I'm locking email and trying to open the email the first time, email is opening my locking activity comes but then and there the email activity is coming to the foreground making my password lock activity go background,but my password activity is supposed to ask for the password and to stay in foreground only it password is entered or it is cancelled</p>
  
  <p>how to handle this problem??</p>
  
  <p>EDIT: I have solved the above problem but still having problem while doing this</p>
  
  <pre><code>activmanager.killBackgroundProcesses(pack);
  </code></pre>
  
  <p>I'm fetching the package name from a service which is running at background to check whether the locked application is started or not</p>
  
  <p>please help</p>
  
  <p>thanks</p>