Quantcast
Channel: Active questions tagged navigation - Stack Overflow
Viewing all articles
Browse latest Browse all 9843

how to save fragments using jetpack navigation like other apps do

$
0
0

Jetpack-navigation works well and is responsive in most applications. For example, YouTube: When you go into it you see fragment container and bottom navigation. Inside the fragment container there is a fragment "home" that contains a recycler view with elements. When you go to another fragment through bottom navigation, you see another recylcer view with elements, the fragment loaded instantly. Going back to "home" the fragment appears instantly. That is, I want to ask: how can you make sure that the fragments are not destroyed and what is inside the recycler view, and also that the fragments and their contents are loaded in advance, using ViewModel and Room to store and display data

I've been looking for an answer for a very long time. I tried to find it in completely different sources. In the documentation, repositories with samples, and in other application source code, I did not understand how this happens. For some reason I couldn’t find AI answers, YouTube videos, articles about this

Many solutions are outdated and not related to jetpack-navigation

I want my fragments and Recyclerview using ViewModels and Room db to be pre-loaded and not destroyed on transition


Viewing all articles
Browse latest Browse all 9843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>