title: How to kill an application with all its activities?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon">Quitting an application - is that frowned upon?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in the SharedPreferences as long as the application needs it.</p>
  
  <p>As soon as the user wants to exit, the password in the SharedPreferences should be wiped and of course all activities of the application should be closed (it makes no sense to run them without the known password - they would crash).</p>
  
  <p>How can I do that?</p>
  
  <p><code>System.exit(0)</code> and <code>finish()</code> only exit the current activity - useless. I know there is a taskmanager app. How is that one doing it? It's able to kill the whole application...</p>