Search code examples
androidandroid-activityrecover

android activity can't recover


When I click my app's icon on the desktop,the splashactivity will first run, then it start the loginactivity before it finished. I click the loginbutton to login.then I came to the mainactivity.Then I click the HomeKey to goto the Android Home. At this time ,I click the app's icon again, the splashactivity start firstly. Why the mainactivity can't be recover? Othewirse,when I click the HomeKey at loginactivity ,the app can skip the splashactivity and recover the loginactivity.Thanks.


Solution

  • Thats very unusual, when a home key is pressed, an app is usually restored in the state it was left. At least thats what i have seen with all apps i have on my phone. What you could do is control your app flow using onPause() and onStop() as they get called when HomeKey is pressed.