FLAG_ACTIVITY_NEW_TASK clarification needed

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:

  1. Create an application with Activity A (launching activity) & B (with the default launch mode for both).
  2. Start the application – a task is created with activity A only.
  3. From a button in activity A, launch activity B with FLAG_ACTIVITY_NEW_TASK.
  4. 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.

Leave a Comment