Questions tagged [navigation-architecture]
35 questions
58
votes
8 answers
Sending data from nested fragments to parent fragment
I have a Fragment FR1 that contains several Nested Fragments; FRa, FRb, FRc. These Nested Fragments are changed by pressing Buttons on FR1's layout. Each of the Nested Fragments have several input fields within them; which include things like…

Timothy Frisch
- 2,995
- 2
- 30
- 64
10
votes
1 answer
Android : Difference between action id and fragment id in navigation component
I have a question that is bugging me for a long time,
In navigation component, when using .navigate(int resId) what makes a difference in passing an action id vs fragment id?
example:

NKR
- 343
- 3
- 15
9
votes
6 answers
Android Navigation Component: Fragments are not visible in drop down list when adding destination from nav_graph.xml
When I am trying to add a destination when clicking
"New destination" button, from the dropdown list I am not able to see any fragments which are already there in my project.
I also face this issue when I am trying to add a blank fragment by…

Rahul Bhavani
- 311
- 2
- 10
7
votes
1 answer
Koin share dependencies scoped to nested graph
I'm wondering how to properly scope dependencies with Koin library.
Since Google recommends a single Activity architecture the AndroidX Navigation lib has become a key library to facilitate this by easily swapping Fragments.
A typical modern Android…

timr
- 6,668
- 7
- 47
- 79
6
votes
2 answers
Fragment backstack building with NavDeepLinkBuilder
I have a single activity app, with three fragments, A, B, C. In the normal app flow, fragments are opened in sequence: A->B->C
I have a foreground service with a notification that when clicked, should open fragment C. I use Navigation Architecture…

vokod
- 143
- 1
- 9
5
votes
4 answers
ClassNotFoundException when using SafeArgs with Proguard and Navigation Architecture Component?
I'm using SafeArgs plugin and Navigation Architecture Component but the app is crashing.
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.package.domain.models.Model"
I'm using minifyEnabled true in the Gradle.
Also, I have three…

OhhhThatVarun
- 3,981
- 2
- 26
- 49
5
votes
1 answer
How to navigate from Service to a Navigation Fragment using probably Pending Intent?
I'm trying to open a fragment with args from my notification.
Actually, in my case, I have Audio Player running with Foreground Service with Notification and now I want to navigate to my fragment for that specific Audio by passing Audio Id when a…

Riajul
- 1,140
- 15
- 20
4
votes
1 answer
How to set `setReorderingAllowed` when using Navigation Architechture?
When postponing a fragment's enter transition when using Navigation Architecture the "home" fragment in the graph is visible for a microsecond. After googling a bit, the docs tell me to set setReorderingAllowed(true) on the fragmentManager to…

Dambakk
- 595
- 4
- 20
4
votes
2 answers
Navigation component arguments default value
In navigation component, While sending arguments from first fragment to second fragment, default values are not getting which set from navigation graph.
Here is my code:
navigation_graph.xml

Nik
- 1,991
- 2
- 13
- 30
4
votes
1 answer
How to handle multiple NavHosts/NavControllers?
I'm having a problem when dealing with multiple NavHosts. This issue is very similar to the one asked here. I think the solution for this question would help me as well, but it's a post from 2017 and it still has no answer. Android Developers…

Rver
- 151
- 1
- 7
4
votes
2 answers
Detect pop in Navigation Component
In Navigation Component, how can one detect if fragment is brought to front from a pop event?
I go from A to B, now I close B using back key, it returns to A, now in A (in onViewCreated event) I want to detect it's coming from B.

AVEbrahimi
- 17,993
- 23
- 107
- 210
3
votes
1 answer
Using jetpack Navigation component transition-animation is not working
I am using the jetpack navigation component for the navigation of fragments, I created an anim at res directory and added this animation-transition:

Mohammad Khalid Ibrahimi
- 379
- 2
- 13
3
votes
0 answers
Pass data to a Fragment launched from the Navigation Drawer using Navigation Destination Arguments defined in the navigation graph
When using Navigation Architecture Components and when launching fragment from the navigation drawer you use Menu and navigation graph where for example the menu below which is for navigation drawer called "drawer_menu"
3
votes
3 answers
Communicating between Activities and Fragments when using Navigation Architecture Component
I want to let the host Activity know when something happens in a Fragment. Traditionally, I would have an interface with a callback that the Fragment can call, but now we are ofc using the navigation architecture component.
Is there a way to pass a…

Dambakk
- 595
- 4
- 20
3
votes
0 answers
NavController.handleDeepLink() not working
I'm trying to handle a deep-link with in the app using:-
findNavigationController.handleDeepLink(intent)
which is not navigating to any page.
here is how I created the intent:-
val deepLinkIntent = Intent()
val deeplink =…

Ayush Agrawal
- 71
- 6