0

I want to clear the activity stack when the user comes back to the dashboard screen. To achieve only one entry point for all the links I have on the dashboard.

How to clear all the activity stacks programmatically?

I know one option of firing the Intent of dashboard activity with the Intent.CLEAR_TASK and Intent.NEW_TASK flag.

Pratik Bhandari
  • 248
  • 1
  • 13

1 Answers1

1

When you call startActivity on the last activity you could always use

Intent.FLAG_ACTIVITY_CLEAR_TOP

as a flag on that intent.

Read more about the flag here.

Arda Kazancı
  • 8,341
  • 4
  • 28
  • 50