Answer the question
In order to leave comments, you need to log in
When attaching a fragment in an activity, why is the string itself not entered?
When I want to attach a fragment to an activity, I need to enter 3 lines, but I keep forgetting to write them correctly, why aren't they entered themselves, like everything else in XML markup? Maybe I unchecked it somewhere or left it unchecked?
android:name="androidx.navigation.fragment.NavHostFragment"
app:navGraph ="@navigation/nav_graph"
app:defaultNavHost="true"
Answer the question
In order to leave comments, you need to log in
you need to first prepare the fragments, create a nav graph, then attach the fragment to the container, when attaching, there will be a selection of fragments, after selection, these lines will be filled in automatically.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question