Closed mahramane closed 5 years ago
All of the lifecycle stuff is really outside of FragNav control (other than using the defined OS methods of hide, detach, or remove) https://stackoverflow.com/questions/9156406/whats-the-difference-between-detaching-a-fragment-and-removing-it . This stack overflow question should give you a bit more insight. However, because this isn't a FragNav specific problem, there are plenty of discussions and potential solutions https://stackoverflow.com/questions/12201695/oncreateview-called-multiple-times-working-with-actionbar-and-fragments .
Without knowing the specifics of what you are trying to do, it's likely that you're either not resetting the state in onDestroyView
(which you should be doing) or that you are maybe doing something within oncreateview/onviewcreated that may belong in a different lifecycle callback. Either way, it's not something that FragNav has specific control over, so the Android Framework should have a solution for what you're looking for. Hope this helps!
Hi can i call only the onResume() method when swith tab?
fragmentHideStrategy = FragNavController.DETACH
callonCreateView()
,onViewCreated()
,onResume()
andfragmentHideStrategy = FragNavController.HIDE
call none from them.