I recently ran into the same problem, I know that it's too late, but just in case someone is looking for her, here is my answer:
Thanks @fasteque for narrowing my search.
The onResume() or onPause() fragments will be called only when the onResume() or onPause() actions are onResume() . They are closely related to activities.
But if you still want to listen to changes in your activity, for example, which fragment is on top and trigger events accordingly, you can take a look at the FragmentManager.OnBackStackChangedListener
Hope this helps :)
Ankit popli
source share