915 questions
3 votes
1 answer
146 views
Jetpack Compose navigate failed when start an activity from a notification
My app has a modal navigation drawer to navigate between home page and target page. I tried to launch the app and navigate to the target page by tapping a notification containing a deeplink intent, ...
2 votes
2 answers
135 views
Jetpack Compose: potential race condition when the user navigates
It is common that onClick lambdas (call methods that) perform viewModelScope.launch { ... }. I see a possible race condition here, the viewModelScope may be cancelled before the launched action is ...
2 votes
1 answer
347 views
How to track screen views in Jetpack Compose using Google Analytics?
In the previous XML-based Android development, it was relatively straightforward to track screen views in Google Analytics by using separate activities for each screen. Now that I’m using Jetpack ...
1 vote
1 answer
297 views
How to convert Drawables to ImageVector to use as custom icons for NavigationBar?
I've been learning android app development the past week and I'm trying to set custom icons for the navigation bar at the bottom of the screen. The NavItems data class is given below: package com....
1 vote
2 answers
193 views
ViewModel#onCleared not called anymore in Navigation3
I just updated the dependencies for: androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "nav3Core" } androidx-navigation3-ui = { ...
0 votes
1 answer
55 views
What is the right way to instantiate a ViewModel inside a Tab Fragment and scope it to the parent navigation destination?
I'm using Navigation Component + Hilt DI. I have a Navigation Destination Fragment which hosts a viewpager with 2 fixed fragments. What is the right way to Instantiate the ViewModels within those ...
0 votes
0 answers
102 views
How to implement per screen TopAppBar and BottomAppBar in Jetpack Compose?
I have my composable MainNavHost which controls the navigation as shown using the new Navigation 3 library. The Scaffold here has my TopAppBar and BottomAppBar for navigating between the 4 major ...
0 votes
0 answers
23 views
Kotlin navigation controller [duplicate]
I've successfully implemented jetpack component and that is navigation controller. I'm encoutering an issue where fragments are recreated when navigating back to previoud fragment. Does anyone know ...
0 votes
0 answers
159 views
How to manage focus (and restore it) between TVLazyRow/LazyRow and focusable buttons in Android TV app?
I am developing an Android TV app using Jetpack Compose and D-pad navigation. My main screen UI looks like this: A Column as the main container The first item is a TVLazyRow or a normal LazyRow (...
0 votes
0 answers
61 views
How can I open files from other apps in my app at a specific screen using Jetpack Compose Navigation?
So I have configured intent-filters in the manifest of the app, my app can be opened from other file browser/explorer apps class MainActivity : ComponentActivity() { override fun onCreate(...
1 vote
1 answer
113 views
Check what screen a NavHost is currently on [duplicate]
Is there a way to know what screen a NavHost is currently on using the new Navigation in Jetpack compose, The route of the backstackentry returns the serialized form of the screen but I haven't found ...
0 votes
2 answers
120 views
Unable to pass args to nested start destination in jetpack compose
I'm using the latest version of Jetpack Compose with type-safe arguments for navigation library. I have a nested navigation structure, and I need to pass a parameter to the start destination of a ...
2 votes
0 answers
87 views
Type-Safe Navigation with Nested Graphs, NavigationBar, and Inclusive PopUp in Jetpack Compose
Is there a proper example of type-safe navigation with nested graphs where one of the graphs includes a NavigationBar with its own screens, and an auth/splash/onboarding screen is removed from the ...
0 votes
1 answer
65 views
androidx.navigation with compose : pass arguments thru nested graphs with typeSafe
this is my nav graph NavHost(navController, startDestination = Splash) { composable<Splash> { SplashScreen(navController) } navigation<Home>(startDestination = Editor) { ...
2 votes
2 answers
387 views
Navigation in multi-module Compose project
I have a multi-module compose project where I am still trying to define how the navigation should be done. As far as I know, the following key concepts need to be taken into account (correct me if I ...