1 | initial version |
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.