When using any of the navigation methods, NavController during the transition destroys the fragment and its states, how to set its behavior - not to be destroyed.

  • Are you sure you need it? This will load the memory. I think the fragment can be saved to a static variable, and check if it is not null, then use a fragment from statics, otherwise create a new one. Another way to use pagerView is to fragments and scroll through them. But this is depending on the circumstances - George Chebotaryov
  • @ Georgy Chebotarev static immediately skip. do you offer to wrap everything in ViewPager in order to save fragments? and completely get rid of NavController, but please read the question carefully. - SweetDev

0