onAttach not called when navigating back through fragment backstack?

529 Views Asked by At

before commiting FragmentTransactions I call addToBackStack("") to implement back navigation properly.

In every fragment's onAttach() I call a function which updates my action bar. This works properly when moving forward, but not when moving back using the back button. I guess onAttach() is not being called.

Any solution for this? Alternatively which function is called each time so that I can update the UI in that function?

0

There are 0 best solutions below