Hide login activity
<p>I have LoginActivity which checks SharedPreferences for login details then it redirects to HomeActivity and other activities after that. I have put Menu item Sign Out on each of this activities and used this code on sign out button.</p>

<pre><code>intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
</code></pre>

<p>How to hide the Login activity, so that when user press back button from home screen it'll close the app.</p>

<p>Like when I open app it shows Home screen and when I press back button normally it should close the app. But in my case it takes me to the Login screen which is the first screen checking user credentials.</p>

<p>I cannot end the Login activity, otherwise that solution doesn't work.</p>

<p>I'm a new to Android. Please suggest something to solve this problem.</p>
