I have 2 activities which are using the same Android task - i.e. they will use the same back stack.
Let's call A
the first activity in the back stack, and B
the second activity in the back stack.
case 1: A
is notified that it goes in the background when A
was in the foreground and then B
comes in the foreground (for any reason, like because it received an external intent).
case 2: A
is notified that it goes in the background when A
was in the foreground but another application was started in the foreground.
Question: How does my app differentiate between those 2 cases? Is there a way to know if the transition A in foreground -> A in background
keeps the current task displayed on the screen?
Basically, I need to get an event when the Android task becomes visible or invisible.