The app has 2 tasks of activities:
- TASK 1
Activity
A (launcher)Activity
B
- TASK 2
Activity
C <---- that's where the stack points at in the example.
Now try that:
- Go to the recent apps carrousel (you know by clicking the button on the right of the Home button in newer phones).
- Swipe all the apps out.
- Your application is killed and a new
Application
instance is created (Application#onCreate()
is called). - Android tries to show the Activity C of the TASK 2.
The funny thing is that if you're here:
- TASK 1
Activity
A (launcher)Activity
B <---- here
...and you do repeat the scenario, your application is killed and android goes back to the Home screen as I think it should.
In short, it looks like Android does not clear all the tasks when killing the application. This is only true in that very precise scenario. Go to Settings > Applications > Your App > Force Stop, and you will see that it does clear all the tasks.
Anything we can do to force Android to kill all the tasks when killing the application?