Questions tagged [android-navigation-graph]
303 questions
0
votes
1 answer
How to use shared element transitions with navigation action
I have two fragments and I want to use shared element transitions between them. But the I still want to use navigation action to pass data between them.
From the first fragment, I only have image uri loaded using Glide and it's from the…

Oluwafemi
- 306
- 1
- 4
- 14
0
votes
0 answers
Cannot remove Fragment attached to a different FragmentManager in NavGraph When setting Programmatically
I need to set a Fragment to nav graph programmatically. I have tried the below approach to set it in my activity but getting the below error "Fatal Exception: java.lang.IllegalStateException: Cannot remove Fragment attached to a different…

marsuser
- 125
- 9
0
votes
1 answer
Changing Permission gives error: You must call setGraph() before calling getGraph()
I am working in Camera application, where if I change my permission manually from settings and came back to activity again, is giving me this error/crash.
You must call setGraph() before calling getGraph().
I am using activity/fragment from…

Usman Khan
- 3,739
- 6
- 41
- 89
0
votes
2 answers
Nav Graph with Bottom Nav View along with other fragments
I have a bottom navigation view with 5 tabs. I am using Nav Graph and linked the bottom nav view with the navigation graph.
My requirement is to have three out of the five tabs to work with Nav Graph and the other two with normal support fragment…

Farooq Arshed
- 1,984
- 2
- 17
- 26
0
votes
0 answers
Does the Navigation component support animation of Dialog Fragments?
I spent 2hrs trying to animate the enter/exit animation on an DialogFragment i want to show. The Android Doc and also the Mad Skills Tutorials ignore this topic completely i think.
So the general question is, does anyone got an animation working…

Kitesurfer
- 3,438
- 2
- 29
- 47
0
votes
0 answers
Android: IllegalStateException with Navigation Component
My app uses android navigation component. There is case where IllegalStateException: Fragment not attached to an activity is logged. I couldn't understand this. The flow is as follows:
The activity_layout has this…

Nitish
- 3,097
- 13
- 45
- 80
0
votes
1 answer
Pop enter animation not working with the Jetpack Navigation Component
I have been using the Jetpack Navigation component (2.3.5, although I have tested older versions too) and trying to add transitions between two simple destinations. However, the transition specified with the popEnterAnim attribute doesn't run at…

Henry Twist
- 5,666
- 3
- 19
- 44
0
votes
0 answers
(NAVIGATION COMPONENT) Best way to navigate to another activity?
What is the best way to navigate one activity to another activity using the Navigation component?
I am using this right now
fragmentLoginBinding.btnLogin.setOnClickListener(v -> {
…

Gunjan Shakya
- 11
- 2
0
votes
1 answer
Open deep link through firebase notification
I want to open a specific fragment in my navigation graph through deep linking.
I added a deep link URL like this
I tried putting the same URL in the payload in the FCM console, but it did not open my fragment, the same thing opens when I put the…

Siddhesh Pawar
- 259
- 4
- 24
0
votes
1 answer
Android Navigation - getting navhostfragment from within hosted fragment
I am creating a simple project and I am using the navigation component. Here is what I am trying to achieve. I have a navigation graph and single activity that has FragmentContainerView that acts as NavHostFragment and NavigationView that displays…

Barracuda
- 477
- 5
- 19
0
votes
1 answer
Android navigation graph add extra fragment to stack on navigation
Solution:
both the accepted answer and the comment from @ianhanniballake work.
Due to the simplicity of the comment i'm going to use the comment one!
Solution:
I am trying the following:
There a three fragments in the navigation graph
1: dashboard…

xtravanta
- 35
- 6
0
votes
1 answer
How to have the same argument for multiple fragments in navigation component?
I have this nav_graph.xml file:

Jane Ashley
- 195
- 1
- 1
- 5
0
votes
1 answer
Android Navigation: removing an activity from the backStack
This question is related specifically to the androidx.navigation library.
I split up my primary graph into 2 graphs because I wanted to have one with a bottom nav with the fragments above it and one without. Instead of using

RyPope
- 2,645
- 27
- 51
0
votes
1 answer
Is this a good way of detecting the current active fragment?
I'm currently trying to determine which fragment is the current active one within the onResume() method.
I'm currently basing the detection off the destination ID. Would the ID be the same for everyone who downloads the app or is it a randomly…

Devin S
- 135
- 1
- 12
0
votes
1 answer
Navigation Component "Back" via device reloads Fragment
The two screens relevant to my issue amount to MainFragment (a master view) and ProfileFragment (a detail view). The launch path from login -> main -> profile works fine. The return path isn't working as well. I get stranded at main when navigating…

es0329
- 1,366
- 1
- 18
- 35