I have two activities, one is MainActivity (the launch activity), the other is MaskActivity. If I start my app from other app, and start MaskActivity from MainActivity (now MaskActivity is on top of MainActivity), problem arises when I press home button on the phone and re-enter my app, a new MainActivity is started and put on top of the MaskActivity and the old MainActivity, which is not what I want.
But if I start my app from program list(not from other apps), things act quite right as I wanted, when re-enter my app, no new MainActivity is started and MaskActivity is on top of MainActivity.
My MainActivity's launchMode is "singleTop", I don't know if this is the problem. Simply change it to "singleInstance" or others can not fix the problem. When changed to "SingleInstance", it won't start a new MainActivity but will bring MainActivity to top. But I want the MaskActivity stay on top when the program resumed if the MaskActivity is on top of the MainActivity before the program paused.
Any ideas?