0

I have A and B activities. A is singleTop on launch, B is excludeFromRecents. When I back from B to A, B is always destroying. How to prevent it? When I press Home then B is just stopped and not destoying. Thanks.

Following back code if B activity:

    Intent intent = new Intent(this, ActivityPlaylist.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);

Without flags back not working at all.

I also have prevention of creating new instance in onCreate of A reason of I launch app from Eclipse (bug):

    if (!isTaskRoot()) {
        // Android launched another instance of the root activity into an existing task
        //  so just quietly finish and go away, dropping the user back into the activity
        //  at the top of the stack (ie: the last state of this task)
        finish();
        return;
    }

Upd: my case is I need do not lose B condition, including list position and so on.

Community
  • 1
  • 1
Konstantin Konopko
  • 5,229
  • 4
  • 36
  • 62

0 Answers0