Why not a duplicate: Suggested post only works for a viewpager, or when onResume is called.
I have a listfragment and a detailfragment. The detail fragment is opened when a list item is clicked. I accomplish this by hiding the listfragment and I showing the detailfragment. When the user goes back, he returns to the listfragment.
How can I detect when the user gets back to my fragment, or when my fragment is visible?
Please note that I would like to keep using .hide() and show() and that I am looking for a listener or a onVisible to check when the fragment becomes visible, and not a method to check if it is visible.