Questions tagged [android-navigation-graph]
303 questions
0
votes
0 answers
how to retain fragments using navigation component?
I am trying to create a side navigation drawer based app using the latest navigation component library ('androidx.navigation:navigation-fragment-ktx:2.5.3'
and 'androidx.navigation:navigation-ui-ktx:2.5.3')
I tried to follow the basic template for…

ansh sachdeva
- 1,220
- 1
- 15
- 32
0
votes
1 answer
NullPointerException: null cannot be cast to non-null type kotlin.Int. When calling navController.setGraph after restarting Activity
Sometimes, the setGraph function causes a NullPointerException: null cannot be cast to non-null type kotlin.Int. It depends on how I restart the application.
When MainActivity is created, it programmatically sets the graph and start destination.…

Andrew
- 2,438
- 1
- 22
- 35
0
votes
0 answers
Problems with multiple back stacks
The problem is as follows: When I go to the fragment with the products, the Bottom Navigation View appears, when I jump through the BottomNavigationView to the fragment with profile and try to return to the fragment with the products, I return to…

Murlodin
- 1
- 1
0
votes
0 answers
Navigate to fragment using navcontroller by sending fragment instance
I want to navigate to a fragment instance using navcontroller but it seems that I cannot add it unless I use the fragment Id or the direction with actions.
So I want to use something as:
val fragment2 =…

htafoya
- 18,261
- 11
- 80
- 104
0
votes
0 answers
Compose navigation: after rotation last object from navigation model is added into backstack
My question is related to the Compose navigation and screen rotation.
After screen rotation, for some reason, as I understand, the composable is re-created and latest value of NavigationViewModel is taken and additional composable/screen is added…
0
votes
1 answer
How to reuse Fragments within a Nav Graph in a multi-module architecture?
Context
I have a multi-module architecture, with multiple feature modules, it kinda looks like this:
I have multiple feature modules that depend on a :core_library library module that contains all the common dependencies (Retrofit, Room, etc.) and…

4gus71n
- 3,717
- 3
- 39
- 66
0
votes
1 answer
NestedFragment navigation With ViewPager2
I'm developing an app which is made of SingleActivity&Fragments.
The project flow is below.
Project flow
The navgraph is below.
Navigation flow
RegisterPhotoFragment has a photo button. If i click the button, it show the…

CodingBruceLee
- 657
- 1
- 5
- 19
0
votes
1 answer
How to clear the whole backstack for all nested NavGraphs?
I have an application with a NavigationBar that includes three destinations. It is configured so that two of the destinations point to a seperate nested NavGraph, namely IssuesGraph and InstructionsGraph. While navigating within the nested graphs…

BenjyTec
- 1,719
- 2
- 12
- 22
0
votes
1 answer
Deeplink Jetpack Compose with no URI
The GPS Matter Commissioning intent filter looks like this, it does not use a URI scheme. If I try adding a URI GPS can't find my app any more.

Jon Smirl
- 349
- 2
- 10
0
votes
0 answers
How to inspect an intent to see if it was an intent that started/launched the app?
How to inspect an intent to see if it was an intent that started/launched the app versus an intent that was used to navigate from within the app or once the app was already opened?
We have special UI handling based on if the intent was launched…

dazza5000
- 7,075
- 9
- 44
- 89
0
votes
1 answer
Using jetpack navigation, does anyone know how to check to see if a deeplink is defined in the app before trying to navigate to it?
The use case is to determine if a deeplink is routable/defined, before attempting to navigate and if it is not defined to route differently.
I came up with the following solution, but was curious if there is a more elegant/differently…

dazza5000
- 7,075
- 9
- 44
- 89
0
votes
0 answers
Navigation Graph giving blank screen after click on blank screen
I have setup bottomNavigation with navcontroller
var navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment val navController: NavController = navHostFragment.navController…

imran khan
- 1
- 2
0
votes
1 answer
Back button problem with BottomNavigationView and navgation graph
I use BottomNavigationView with navgation graph and I expect that when I press the back button, I'll exit the app. But that only works when I'm in the first fragment.
When I'm in other fragments, I press the back button and I'll go back to the first…

Martian
- 1
0
votes
0 answers
Android NavGraph Circular Include
I have two separate navGraph.
The functionalitiy is the following:
By default the user arrives at navGraph A and then he/she can move to navGraph B by pressing a button.
But with a push notification the user's screen opens up with navGraph B and if…

No_Name
- 128
- 8
0
votes
1 answer
How to navigate to 2 different fragments using same adapter according to the type of model?
I want to navigate 2 different fragments using same adapter according to the type of my model. But my problem is I can't handle onItemClicked with two different models. As you can see:
private val onItemClicked: (WordsWithMeanings) ->…

oguzata
- 33
- 6