F
F
foonfyrick2020-09-21 12:57:46
Android
foonfyrick, 2020-09-21 12:57:46

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

1 answer(s)
F
foonfyrick, 2021-01-04
@foonfyrick

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 question

Ask a Question

731 491 924 answers to any question