Saving Android application state
<p>I understand how to save an application's state by using SharedPreferences, onSavedInstanceState() &amp; onRestoreInstanceState(), etc as outlined in a similar post ( <a href="http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state">http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state</a> ), but how do I save the last activity?</p>

<p>To be more specific, my application starts up and goes to a login screen. Once a user logs in and navigates through several activities, lets say he or she leaves the app using the home button or in some other way. Next time the user starts the app, it will go back to the login screen and do a login again. Instead, I want the app to start up and go to the last activity that was on top of the stack when the user left the app in the previous session.</p>

<p>How is the last activity saved so that it can be restored on app startup?</p>
