Hello there, I have some questions about nav_graph...
# android
a
Hello there, I have some questions about nav_graph, hope anybody can help me. Thank's a lot. Every activity should contain a navigation graph? It is ok if I have just activities and I don't use a navigation graph? If I have one host activity, how many fragments are ok to use for navigation? There is a stack that remains in memory and which I can overload? When I need activities and when I need fragments?
😶 2
r
Every activity should contain a navigation graph?
in short no. nav graph meant to fragment
It is ok if I have just activities and I don't use a navigation graph?
yes
If I have one host activity, how many fragments are ok to use for navigation?
as many as you want,
When I need activities and when I need fragments?
fragment kind of reusable component. (even though you can achieved same thing by using compound view or compose)
a
To the point, thank you. Thinking about your answers, I wonder about another question. If I want to navigate between two activities, I don't need to use a new navigation component and instead, I can navigate with Intent. This is true?
r
no needed a plan startactivity would work
a
Understand. Thanks👍
i
Actually, you can use
activity
destinations to navigate to other activities: https://developer.android.com/guide/navigation/navigation-create-destinations#create-activity
👍 5
a
Really useful. 👍
m
@Ian Lake I didn’t know you could declare 3rd party app activities like that. Out of interest, how is the
android:label
argument used?