title: Clearing all activities in android
body: <p>I have 4 Activities 1.Home,2.B,3.C and 4.D. Whenever I start Home from Activity D I want to finish all other activities. I Used this code, but when I press back button from Home it brings me to the previous activity. What I did wrong here.?</p>
  
  <pre><code>    Intent intent = new Intent(getApplicationContext(), Home.class);        
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      startActivity(intent)
  </code></pre>