Issue
So my problem is:
- I start App1, open Screen1 and then Screen2.
- I press Home, leaving App1 in the background.
- I open App2 and start App1.Screen1 with FLAG_ACTIVITY_NEW_TASK expecting to be on App1.Screen2 in the previously left task. Instead, I'm on App1.Screen1 and the system called onNewIntent().
When I press back, it brings Screen2 and Screen1 again. I don't use any other intent flags or launch modes.
Could someone explain what's happening??
Solution
Android has TONS of bugs related to activities and tasks.
Nevertheless, Google changed the behavior of tasks between OS versions and didn't notify the developers, which is the most annoying thing about it.
If you didn't set any flags on the activities (A or B), then the behaviour you are describing is WRONG.
And for all those who say that there is no problem with the documentation, try this:
- Create an application with Activity A (launching activity) & B (with the default launch mode for both).
- Start the application - a task is created with activity A only.
- From a button in activity A, launch activity B with FLAG_ACTIVITY_NEW_TASK.
- Click the button several times and you'll see that activity B is created multiple times inside the task, which is NOT as the documentation says.
There are more scenarios to prove that the documentation is BAD / WRONG.
Answered By - user267545
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.