0

Android studio home button problem.

I have so many activities, when I press home buttom in any activities.

Then if I restart my app.

it started from splash activity(logo activity).

However, I want to start this from activity where I pressed home button.

Can anybody figure this out?

AMoon
  • 11
  • 1

1 Answers1

0

By default, Android handles this behavior. When you press the home button, the app should go to background and at the next time when you open it, it should start from where you left off. But, Android's memory management is designed to automatically terminate minimized apps that have not been accessed in a while when memory is needed for newly launched apps.

If there is enough memory available and still your app gets terminated, that means you are not using the API's correctly. Please read this [article] to know how to handle onPause() and onResume() to achieve this behavior.

Msp
  • 2,493
  • 2
  • 20
  • 34