My app contains a ViewPager which holds 5 fragments. When fragment 1 is visible, it also calls fragment 2's onCreate method. I tried using onAttach
, onMenuVisibility
, etc. But I don't like how these perform in my app.
Is there a way to disable a fragment's onCreate being called when the adjacent fragment is visible?