jetpack-compose-navigation Questions

3

From the docs, I see you can nest navigation graphs like so: NavHost(navController, startDestination = "home") { ... // Navigating to the graph via its route ('login') automatically //...

4

I am trying to navigate lets say from onboarding to dashboard and beyond and pop the onboarding once user hits dashboard, but still with 'back action' I end up on onboarding again. Here is the samp...

1

Solved

My app uses hilt and I have some work with LoadManager inside my activity that read contacts using ContentResolver and when I finish work I get the cursor that I send to my viewModel in order to pr...

1

In Android I often want to navigate is response to state change from a ViewModel. (for example, successful authentication triggers navigation to the user's home screen.) Is the best practice to tri...

0

I come across requirement where I have to do certain task when user is coming via back navigation flow. Suppose : Currently user is on A Screen and on button click it got navigated to B Screen. On ...

1

Solved

Here is the code that causes the infinite recomposition problem MainActivity class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(saved...

1

Solved

I am trying to implement Navigation using single activity and multiple Composable Screens. This is my NavHost: @Composable @ExperimentalFoundationApi fun MyNavHost( modifier: Modifier = Modifier, ...

2

Solved

I am trying to build below navigation for my order management app: manage_orders/manage_orders/{locationId} manage_orders/manage_order_details/{orderId} And here is my navigation code for that: in...

1

Solved

I'm trying to get the code from GitHub Oauth API playground://gh?code=XYZ in the ViewModel through savedStateHandler. My composable screen configuration: NavGraphBuilder.composable( route = "...
Lumberyard asked 2/6, 2022 at 20:16

2

During navigation from Navhost, I found out that the composable screens are getting recomposition multiple times. Because of it, my ViewModel is calling API data source multiple times too. @Composa...

1

Solved

My goal is to to have a LoginScreen from which I can navigate to an InternalScreen. The InternalScreen should have/be a bottom navigation bar that can navigate to multiple other screens/routes in t...
Minutia asked 25/2, 2022 at 16:15

1

Solved

I am having this issue where I have to navigate when given state gets updated after an asynchronous task gets executed. I am doing it like this: At ViewModel.kt fun executeRandomTask() { viewModel...

1

Solved

When using Jetpack Compose navigation, would one use one ViewModel for all screens or one ViewModel for each screen? Is there any architecture guidance on this? And if one would use multiple ViewMo...

1

Solved

Is it possible to set the value of a FloatingActionButton's onClick inside of a Scaffold from a screen composable from a NavHost, which is also inside the Scaffold? Here in my example, I want to be...

1

Solved

I want to use outlined and filled icons based on selected state in NavigationBar just like google maps app, using jetpack compose. In case of xml we use selector so what do we use for compose ? Her...

0

As far as I know, before jetpack-compose, It was good practice to have one single activity and then use multiple fragments for your app. But now jetpack compose offers navigation between jetp...
Magdamagdaia asked 19/9, 2021 at 21:29

0

I checked out answers here and here to pass an Object from one composable to another and passing an @Serializable object as String from one composable to another but get the resulting error java.l...

1

Solved

I am trying to set up the navigation back button following this SO thread, but can't make it work. @ExperimentalFoundationApi @Composable fun LazyVerticalGridActivityScreen() { val navController =...
Sheathbill asked 8/8, 2021 at 12:40

1

Solved

I was trying to implement jetpack compose bottomnavbar. But I encountered this problem. Whenever label don't get enough space it's overlapping the icon. Am I missing something? Is there any solutio...

0

I run into a weird error after upgrading compose to 1.0.0-beta08: java.lang.IllegalStateException: Check failed. at androidx.compose.ui.node.OuterMeasurablePlaceable.getLastConstraints-msEJaDk(Out...

© 2022 - 2024 — McMap. All rights reserved.