Home:ALL Converter>Android Navigation Component Recreates Bottom Navigation Fragments

Android Navigation Component Recreates Bottom Navigation Fragments

Ask Time:2019-12-25T20:46:04         Author:user11318796

Json Formatter

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.

Author:user11318796,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59478532/android-navigation-component-recreates-bottom-navigation-fragments
yy