title: How to restore android app after some task killer has killed app?
body: <p>In my App I have several activities which are obviously related to each other. Whenever I am on some activity and the user kills my app by using any task killer. I want to do two things </p>
  
  <blockquote>
    <ol>
    <li>Clear the Notification which I added when the user logged in..</li>
    <li>finish all the activities other than the first Activity i.e. Login Activity</li>
    </ol>
  </blockquote>
  
  <p>Now if user starts again my app either from the recent tasks or from launcher I want to start from the first activity i.e. Login Activity... </p>
  
  <p>Presently my code works absolutely fine if I use android <strong>manage process</strong> and end the activity or force close the app from <strong>android task manager</strong>. But if I am using some other task killer app i.e. Advanced task killer, after closing the app when I relaunch the App from recent apps the it tries to restart from the last used Activity instead of Login Activty and gives an ugly force close error... The Notification is also not cleared when in this case.</p>
  
  <p>How do I handle third party task killers ? </p>
  
  <p>I have read several threads on SO but couldn't get the pointers, few of them are ... </p>
  
  <p><a href="https://stackoverflow.com/questions/3461951/how-does-the-android-advanced-task-killer-app-work">related to task killer</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3461743/how-to-cancel-android-notifications">related to Notification</a></p>