Bobans
Bobans

Reputation: 439

home button pressed

What exactly happens when I press home button in Android? Because when I open it again after home button pressed, it has series of bugs. I need to know it to track down the point that causes that bugs.

UPDATE: when pressing home button, application goes to background and onPause() is called and saves the state of UI, however it does not save state of application, like variables, custom views. And you have to save them manually, as Oren explained.

Upvotes: 2

Views: 1615

Answers (2)

Oren
Oren

Reputation: 4252

Technichally? Anything can happen, from just onPause being called, to the device killing the app to free up memory, to the user shutting down and restarting the device. Your app should handle all of these possibilities.

Further reading : android activity lifecycle

Upvotes: 0

Lalit Poptani
Lalit Poptani

Reputation: 67296

When you press Home Button your Application/Activity goes in background and when you open it again it resume from the same position as it was until it was being killed/closed by the OS.

Activity Life Cycle will give you a clear idea about it.

Upvotes: 2

Related Questions