title: Android kill all other activities on starting a new one
body: <p>I have an android activity problem.</p>
  
  <p>Here is how my process works:</p>
  
  <ol>
  <li><code>Login Activity</code> starts</li>
  <li>Login successful. <code>MainMenuActivity</code> starts and LoginActivity is finished by me.</li>
  <li>User touched on settings and SettingsActivity starts. <code>MainMenuActivity</code> is NOT finished. because is it the main menu. when user presses the back on settings screen I need to go back <code>MainMenuActivity</code>. so I cant kill <code>MainMenu</code>.</li>
  <li>User touched on log out and <code>SettingsActivity</code> is finished by me and Login activity starts. As user returns the login I need to kill <code>MainMenuActivity</code> but I cant.:/</li>
  <li>I tried <code>FLAG_ACTIVITY_SINGLE_TOP</code>, <code>CLEAR_TOP</code>, <code>SINGLE_TASK</code>, <code>NEW_TASK</code>, <code>NO_HISTORY</code> etc.. almost all of them didnt work</li>
  <li>I put <code>launchMode="singleTask"</code>, <code>clearTaskOnLaunh="true"</code> etc. didtn work again.</li>
  <li>I tried <code>addFlags()</code> and <code>setFlags()</code> both, didnt work</li>
  <li>There are some many issues about this topic here, I read and applied all the suggested solutions and didnt work.</li>
  </ol>
  
  <p>Can anyone help, please?</p>
  
  <p><strong>P.S</strong> <code>android:minSdkVersion="8"</code> and <code>android:targetSdkVersion="15"</code> for my app. I didnt use fragments in the app, I use old activity structure.</p>