In this tutorial you’ll use the Jetpack Navigation component to write an Android app utilizing graphs and deep links to navigate through different screens.
Thank a lot for the tutorial. everything was going great when I user viewModel in graph scope. But the problem began when I tried to user LiveData to assign Value of header layout’s textView and Image View. I call a api from my host activity to retrieve value of User Info which is written in shared ViewModel. When I call that ViewModel from my host activity, it said “No NavGraph with ID 2131362500 is on the NavController’s back stack”. That’s why viewMOdel isn’t initialized. So Api call is not triggered.
Finally, I have solved the problem. Cause I gave wrong parameter in initializing viewModelProvider. I used navigation_fragment instead of navigation_graph. That’s why i was in trouble. Now Problem Solved