Questions tagged [android-jetpack-navigation]

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

834 questions
12
votes
6 answers

androidx Navigation: Too many arguments for @NonNull public open fun

I am using Navigation Editor in Android Studio to implement Safe Args. I am accepting arguments in one fragment as
12
votes
2 answers

Can we use Android Jetpack Navigation Component with Settings preferences?

Is it possible to use Android Jetpack Navigation Component to navigate the fragments of a Settings Preferences? I have a Settings screens with multiple nested Preference Fragments. I was wondering if it is feasible to use Android Jetpack Navigation…
11
votes
3 answers

Preview a "screen" in android jetpack compose navigation with a PreviewParameter NavController

I discovering android Cetpack Compose (and Navigation) and try to display a preview of a view with a navController as parameter. To achieve, I use the PreviewParameter and I have no error, but nothing displayed in the Preview window. Anyone know how…
11
votes
1 answer

Android Navigation Component - navigate from "anywhere"/base fragment?

I'm working on an app that has a quirky gimmick to open a specific fragment when the device is rotated. Before implementing android's navigation component, all that was needed was a reference to the current activity, and a manual fragment…
Halvtysk
  • 257
  • 2
  • 10
11
votes
1 answer

Navigating out of ViewPager tab using Navigation Components

First, some clarifications. After looking at a lot of other related questions let's start with what this is not: This is not about BottomNavigation This is not about operating the ViewPager using Navigation Components (like this one) This…
11
votes
2 answers

How to navigate with nested navGraph and bottom navigation view

I've bottom nav view with 3 item, My navGraph looks like this:
11
votes
7 answers

Navigation Component: IllegalStateException Fragment not associated with a fragment manager

I'm using the Navigation Component version 2.1.0-rc01 and I navigate back and forth between 3 screens using Navigation.findNavController(it).navigate(R.id.action_participants) After going through the same screens a second time I can see the second…
11
votes
1 answer

Navigation component shared element transitions works for enter but not for popping back

I'm trying to use a shared element animation between 2 fragments, BlankFragment and BlankFragment2. BlankFragment has a recycler view and BlankFragment2 is a details screen. They share an image and I'm using the new navigation component. In…
10
votes
3 answers

Jetpack Compose Navigation: Direct navigation to route in a nested graph which is not startDestination

I am working on Jetpack Compose Navigation demo and I have a nested navigation graph with two different nested routes and screens for each nested route: Login Graph Main Graph Login Graph has three routes for display three different Screens Route…
10
votes
2 answers

Why the view keeps flashing when using jetpack navigation with Compose?

I have a login scren and when the login is successful and the view model updates the mutable state variable, my expectation is that a new composable function is called to show a new screen and the login one is removed. The problem is that when the…
10
votes
4 answers

How to switch to other fragment in different back stack using Navigation Component?

I have 3 bottom navigation tabs called Home, Dashboard, Profile. In Home, I have Fragment1 and Fragment2, In Dashboard, I have Fragment3 and Fragment4 And in Profile, I have MyProfile and EditProfile. Now, in Fragment2, a button changeAvatar can…
10
votes
1 answer

Navigate to a particular fragment when app launched from sharesheet

I am using Jetpack Navigation in my app having a single activity and two fragments (Fragment A which is also the home fragment and Fragment B which can be navigated from Fragment A). There is an intent-filter added to the MainActivity as shown below…
10
votes
5 answers

Hide Toolbar back arrow with NavigationComponent and BottomNavigationView

I'm in the process of implementing NavigationComponent coupled with a BottomNavigationView and I am noticing that the back arrow is shown in the toolbar for all fragment destinations except the one specified as the startDestination in my navigation…
9
votes
1 answer

Paging 3 list auto refresh on navigation back in jetpack compose navigation

I am using Jetpack Compose, along with Paging 3 library & Jetpack Navigation. The issue I am facing is I have a LazyList which is fetching data from remote source using paging library. ViewModel fun getImages(): Flow> =…
9
votes
1 answer

Jetpack Navigation: how to navigate from child of one nested graph to child from another nested graph?

Navigation structure: MainActivity |- nav_root |- HomeFragment |- AuthNestedGraph | |- nav_auth | | |-BeforeOtpFragment(home) | | |-OtpFragment | |- ProfileNestedGraph | |- nav_prfole | | …