My application doesn’t force close but it does return to the login screen after clicking the home screen or on clicking the recent items.
Do i have to save the state of the app on each activity or something ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The task stack by default can be cleared by the system after a half hour or so by the system; your app can also be killed while backgrounded at any time (but normally with the task stack intact). This should restart whichever activity was on the top of the stack, but if your code depends on some non-static-final properties on the Application class or on non-persistent Activity properties (for instance, if you’re caching login data in a static variable on your Activity or class and not storing/restoring them to/from a Bundle onPause()/onCreate()) you could inadvertently be bouncing the user back to the login screen because you’re losing track of that data. See the Android documentation on activity lifecycle and the task stack for more on that.