0

I made a simple application in which i have tabs and each tab has its own fragment. From each fragment you can navigate into other fragments (by clicking on items in a list to display their details). My question is how do I add a back button to the child fragments ? such that when i click on it, the back stack is popped.

I tried getActivity().getActionBar().setDefaultDisplayHomeAsUpEnabled(true);

but that doesn't do anything + from my understanding this works if I am doing it with activities not fragments.

K.A.Q
  • 469
  • 4
  • 13
  • Possible duplicate of [Implementing back stacks with fragments](https://stackoverflow.com/questions/37206351/implementing-back-stacks-with-fragments) – Asad Mukhtar Dec 30 '17 at 11:51
  • My question is not implementing a back stack but how to add an up navigation button to child fragments (which will pop the back stack when clicked). – K.A.Q Dec 30 '17 at 12:26

0 Answers0