3

Say I have an activity stack as such: A -> B -> C -> D

I would like to create a new activity "E", and end up with a stack like this: A -> B -> E

Basically, upon hitting the back button in activity D, I need to swap out activity C for activity E, and land on it.

Is this possible? Or should I be structuring the navigation differently somehow? Thanks!

datWooWoo
  • 843
  • 1
  • 12
  • 42
  • you can add a slide animation(to look like moving to backstack) and `startActivity` according to your needs !! while going from C - > D **FINISH** C – Santanu Sur Mar 06 '18 at 08:39

1 Answers1

1

so while going from activity C to D finish(); C activity.

At last at backPress method of Activity D call activity E and finish(); Activity D

007
  • 516
  • 1
  • 5
  • 17