Navigation between different screens and apps is a core part of the user experience. Android Jetpack Navigation Component helps the developer to implement it following the good practices. For more info see documentation: https://developer.android.com/guide/navigation
Questions tagged [android-jetpack-navigation]
834 questions
5
votes
2 answers
Scaffold with TopAppBar integration with Navigation
How to show navigation icon (BackArrow or Menu) in TopAppBar using Scaffold based on actual position in NavController? I am using Navigating with Compose 1.0.0-alpha02. Below is a sample code with a description of how it should work
@Composable
fun…

iknow
- 8,358
- 12
- 41
- 68
5
votes
1 answer
how to change toolbar icon (hamburger icon) when using navigation drawer with jetpack navigation component
I'm using jetpack navigation component to build a navigation drawer, I want to change hamburger icon of the toolbar, I tried many solutions like bellow but they don't…

Blind Side
- 53
- 5
5
votes
1 answer
Navigation Resource displays No NavHostFragments Found
I am running Android Studio 3.6.3 and I am trying to use the new Navigation resource that is part of Android Jetpack. I did the Navigation Codelab to learn how to use this feature.
In my project, I added a Navigation resource and Android Studio…

Matt Mc
- 8,882
- 6
- 53
- 89
5
votes
1 answer
Android Jetpack Navigation Component too slow. What's the problem?
Today I was changing from ViewPager to Navigation Component (with Bottom Navigation View) on my Android project. The problem is that, when using ViewPager all is fast as lightning but using Navigation Component it's very laggy (2 seconds later after…

jonealex
- 51
- 2
5
votes
2 answers
Android Is it possible to have multiple nav_graph files?
So I was using Jetpack navigation and the number of fragments kept growing up.
We can separate fragments in different navigation graph as described in this document
jetpack nav graph docs
Then I tried to put different nav graphs in different files…

erluxman
- 18,155
- 20
- 92
- 126
5
votes
1 answer
How to scope a Coroutine to a Fragment so it automatically cancels when Fragment is off screen or is destroyed?
I have this Fragment that just serves as a splash screen while data is retrieved. The problem is that on a configuration change or if the Fragment is offscreen (user navigated out of the app) it crashes when it returns from the IO Coroutine block…

nicoqueijo
- 872
- 2
- 11
- 28
5
votes
0 answers
JetPack Navigation navigate to parent graph from child module
I’ve been playing around with JetPack’s Navigation Component. For the most part it’s pretty decent, although I’ve run into a few problems/cases for which I’ve not yet found a decent solution.
Let’s say we have a Single Activity app with Modular…

Schadenfreude
- 1,522
- 1
- 20
- 41
5
votes
1 answer
Using Serializable as deep link argument with Android Navigation Component
Is it possible to use a custom Serializable object as a fragment argument when using deep links?
I've tried the following - in my navigation graph XML file I've added following lines:

Piotr Aleksander Chmielowski
- 5,640
- 7
- 29
- 45
5
votes
1 answer
How to check Navigation Destination is in the NavController back stack or not?
What I am exactly looking for is that wether my fragment is already in the back stack or not.
For example, I navigate to Fragment A to Fragment B. Later, I navigate to Fragment B to Fragment C. Now, I want to check in the Fragment C that is there…

Harsh Patel
- 657
- 11
- 26
5
votes
1 answer
can I pass viewmodel scope in another class? coroutines
I use suspend function in Pagging Library Jetpack.
in loadAfter() and loadInitial() I use retrofit suspending functions. For this I need to use GlobalScope which is not recomended, How I can pass viewModel's scope?

Nurseyit Tursunkulov
- 8,012
- 12
- 44
- 78
5
votes
2 answers
Achieving proper scrolling with RecyclerView, android jetpack navigation and a collapsing Toolbar
I try to implement proper scroll behaviour with the following setup in my android application.
For navigation I use the jetpack navigation in combination with a Toolbar layout and a bottom navigation. I also use the principle of 'one activity, many…

GooTZ
- 53
- 4
4
votes
1 answer
Android: How to prevent Scaffolds top app bar from redrawing in Jetpack Compose Navigation?
When navigating between two Screens, where each holds a Scaffold with a TopAppBar, the TopAppBar is animated to go out of the UI and back in. (short white flash in my example, just like the button animation)
I guess this behaviour is expected as…

Gamer2015
- 195
- 6
4
votes
2 answers
State hoisting in Kotlin onSearchChange: (String) -> Unit
I am trying to use state hoisting in android
I am new to android development using jetpack compose
onSearchChange: (String) -> Unit,
onCategoryChange: (Category) -> Unit,
onProductSelect: (Product) -> Unit,
composable(Screen.Home.route) {…

KH-
- 43
- 3
4
votes
1 answer
How to prevent re-render of previous screen when navigating back - Jetpack Compose?
I have two screens - MapScreen(Google Map SDK) and Search Screen.
I navigate from MapScreen to SearchScreen by pressing the "Search" button on the top.
When I am on SearchScreen(White screen) - I press the back button to navigate back to Map…

Biali
- 103
- 1
- 6
4
votes
0 answers
Back stack is getting cleared when we navigate between activities via deeplink URI
I have an ActivityA and an ActivityB (in a library module). I navigate from ActivityA to ActivityB via startActivity().
Inside ActivityB I have a NavHost and a Composable which is resolving a deeplink.
When I press back, I have the ActivityA in the…

Vikram Ragu
- 169
- 1
- 8