I have a sample app with 3 activities: Main, A and B. None of them has any launchMode.
Now I do this:
- open the app, Main activity is displayed
- leave the app using back button, so that there is no activity running
- receive a broadcast which starts a new activity A (new_task flag)
- open activity B by clicking on a button in activity A (no flags)
- receive a broadcast which starts a new activity A (new_task flag)
- new activity A is not started (if I go back, there's still the previous Activity A)
At step #6, activity A should be presented but is not.
If I try to present activity C instead (in #5), it is presented as expected.
If in #2 I leave the app by homebutton instead, everything works as expected.
How is this possible? And how can I ensure that the activity is always presented? I could use FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP, but I want to maintain the backstack.
from Android activity not started if already in the backstack as the root?
No comments:
Post a Comment