0

I have an Activity (A), that launch an other (B), in this activity (B) I have some fragments. When I press back on my activity B it's going correctly to the previous fragments, but when I click on back on the last fragment in the stack, it returns to the previous activity.

How can I do to not returning to the previous activity at the end ? (And also quit the app instead)

ChargerDukes
  • 373
  • 1
  • 4
  • 9

1 Answers1

0

Have you tried using your FragmentTransaction's addToBackStack(String name) method? As in:

fragmentTransaction.addToBackStack("NewFragment")