Android navigation component replaces fragments present in the app and calls onlyonDestoryView()
, but the fragments in bottom navigation get destroyed completely ,onDestory()
is called.
The Question is:
How can I prevent bottom navigation from completely destroying fragments that belong to bottom navigation and not calling onCreate()
everytime I switch to one of them.
In view pager we had offScreenLimit that hold the fragments without destorying their views.