[Solved] What happens when back button or home or application removed from recent apps [closed]


As far as I can understand, you want to know that what does happen with application data when following actions performed:

  1. When exits from Application using device back button
  2. When application goes background after tapping Home button
  3. When application removed from recent application list

1. When exit from Application using device back button

When user exits from certain application then all the activities of that application are being removed from ativity stack and all related data also being removed from stack and heap by android system.
If user expect some other behaviour then developer needs to override the onBackPressed() method.

2. When application goes background after tapping Home button

When application goes background using Home button then activities of that application are keeped in back-stact by activity manager.
Preserving application data is dependent on how developer handled them in onStop() method.

3. When application removed from recent application list

In this case, all the activities of that application are being removed from ativity stack and all related data also being removed from stack and heap by android system.
If user expect some other behaviour then developer needs to override and customize the onStop()/onBackPressed() method.

I hope this little explanation will help you.

5

solved What happens when back button or home or application removed from recent apps [closed]