How to find HOME key press pause reason from a non-launcher android activity

38 Views Asked by At

When HOME button is pressed activity goes pause state but if the activity is NOT a launcher or MAIN activity then I want to find actual reason why the top activity goes pause state.

Would someone suggest how I can get pause reason from a non-launcher/ non-home activity which is on top before goes to pause due to HOME button press action?

1

There are 1 best solutions below

1
Gabe Sechan On

That's ecpected behavior. The HOME button brings up the launcher app. That means the launcher app's activity is now the foreground activity. There is only one foreground activity in Android at a time. That means whatever was previously the foreground activity will be paused, then stopped (unless for some reason part of it remains on screen, which would be weird but possible with a 3rd party launcher I suppose).

Why don't you think it should be paused? I think you don't understand how activity lifecycles work.