If you are unable to redraw NavGraph fragments using setGraph(), you may try one or more of the following solutions:
Use Navigation Action: You can create a navigation action to navigate to the fragment you want to display and call the action using Navigation.findNavController(view).navigate(actionId).
Use FragmentManager: You can use FragmentManager to replace the current fragment with the target fragment.
Use Dynamic Feature Module: If you have implemented your app with dynamic feature modules, you can use them to load new content without having to redraw the entire NavGraph.
Use LiveData: LiveData can help you update the UI every time the data changes. You may set up a LiveData observer in each of the fragments, and whenever you need to redraw the fragments, you can update the LiveData values.
Use ViewModels: You can store the state of the app in ViewModels and use them to redraw the fragments whenever necessary.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-26 11:37:25 +0000
Seen: 10 times
Last updated: Jun 26 '23
How can you ensure the safe operation of an Apache container on Kubernetes?
How can I use VS Code and R to create plots?
How can folders be created for each month using react pdf?
What is the meaning of the term deprecated with regards to react-google-login?
How can I use .populate() in Mongoose to select specific fields?
What explains the variation in performance between the benchmark's C version and its AVX2 version?
What is the process for preserving all Docker images and transferring them to a different device?