Alessandro Ercini
Alessandro Ercini

Reputation: 1

Clearing backstack when navigating from a Fragment to an Activity

Lets say I have 2 Activities: A1 and A2 and 2 Fragments F1 and F2 (used only by A2). I go A1->A2->F1->F2->A1. From A1 i dont want the user to be able to go back to F2. The easiest solution would be to intercept the Back pressed, but i want to mantain it enabled. A1 cant go back only if the previous fragment was F2.

I tried replacing the fragment from F1 to F2 instead of using the Nav controller and intent.addFlags, but didnt work.

Upvotes: 0

Views: 11

Answers (0)

Related Questions