1,227 questions
0
votes
0
answers
75
views
Android Compose navigation arguments saved unnecessary
While using android navigation compose have a problem with saved navigation arguments.
For example, i have following routes:
@Serializable
object ScreenA
@Serializable
data class ScreenB(val id: Long?...
0
votes
1
answer
59
views
Android: How to change the FragmentManager Backstack when going back (insert a new fragment)?
I'm trying to add a view to the fragment stack, without any visible indication that it happened, so it appears when going back.
Forexample,
3 Fragments, A, B and C
A -> C
Then when going BACK from ...
0
votes
1
answer
63
views
Android Navigation - Is there a better way of changing the App Action Bar back button color to white?
I've been trying to get the back button to become white using the default App Bar in my Android App. I looked at and tried a number of suggestions in this post as well and ran up against the following ...
0
votes
1
answer
67
views
Android app crashes on launch: java.lang.ClassNotFoundException for existing Composable screen class
I'm building a Quran app using Jetpack Compose in Kotlin. The app builds successfully and installs on a real Android device (Samsung S908E), but crashes instantly on launch.
Crash Log:
Caused by: java....
2
votes
1
answer
128
views
Why can't I use serializable objects with NavHost?
I'm learning how to use NavHost, but I don't know why Android Studio keeps telling me that NavHost doesn't have any options to use serializable objects:
None of the following candidates is applicable:
...
0
votes
0
answers
14
views
Responding to fragment navigation changes in androidx.navigation
The documentation for FragmentNavigator says
The current Fragment from FragmentNavigator's perspective can be retrieved by calling FragmentManager.getPrimaryNavigationFragment with the ...
0
votes
1
answer
157
views
Compose Navigation how to check current navigation's route and match it with data class/object?
@Serializable
data object HomeRoute
composable<HomeRoute> { entry ->
HomeRoute(...)
}
val currentBackStackEntry = navController.currentBackStackEntryAsState()
val route = ...
0
votes
0
answers
52
views
Android Compose Navigation out of Scaffold
my Compose app is structured with a Scaffold with its NavHost and BottomNavBar. The scaffold contains three navigation graphs, each of them containing several composables. Navigation can be achieved ...
0
votes
0
answers
62
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(...
0
votes
0
answers
41
views
Desparate navigation structure with Official Navigation Library
I'm aiming this scenario:
I have different features like auth with 3 screens, profile with several screens, email with several screens and so on... I want to setup a navigation structure that mainly ...
0
votes
0
answers
33
views
how to reopen exisiting destinations in back stack avoiding duplicates in jetpack compose
Lets say A is the start destination then i opened B and next C which makes my backStack
A->B->C. Great now How can i navigate to existing B without creating a new B such that my backstack now ...
0
votes
0
answers
71
views
Multiple back stacks without clearing parent back stack (Jetpack Compose)
My project has a bottom bar with tabs A, B and C.
Tab C view has its own navigation C1, C2, C3.
Now if the user navigates e.g. C -> C1 -> C2, than goes to tab B, than back to tab C again, I want ...
0
votes
1
answer
72
views
findNavController().navigate from composable in fragment leads to exception
I have a normal fragment subclass that used to be based on views & used viewbinding. I'm migrating to compose slowly so I've basically removed the view-related code and now use the onCreateView() ...
2
votes
2
answers
418
views
SafeArgs does not work anymoe after Android Studio update
I have an app that has been working properly for many years and I also installed it on several phones and tablets without any problems. Unfortunately I mad an update of Android Studio (from Flamingo ...
0
votes
0
answers
39
views
Icons doesn't change color in BottomNavigationView
I want to change the icon color from the icons in the BottomNavigationView via Java (I don´t know the color of the icons before I started the app). I tried several things, but non of them worked for ...
0
votes
1
answer
212
views
Restoring view model state when navigating back
I have a question about how to handle back navigation for a specific situation in my project. The basics look something like this:
I have a tutorial (written all in Compose) that's split into three ...
1
vote
1
answer
158
views
Navigation Compose Type Safety got issue when navigate back from other app
I’m using the Navigation Compose type-safe routes feature with Kotlin serialization. My routes are defined as @Serializable objects to achieve type safety in navigation. Everything works fine until ...
0
votes
1
answer
34
views
Use navigation or display composable according to account verification state?
I have an app that uses authentication. When a user signs up, the requirement is to verify the account. In my current approach, as soon as the authentication is successful, I navigate the user to the ...
3
votes
0
answers
53
views
How to Properly Handle Navigation and Back Stack Logic in Jetpack Compose Navigation?
I need an implementation that follows this navigation pattern. For example, there are screens a, b, c, and d. The navigation sequence is a > b > d > c > b > d. When we are on screen d ...
2
votes
0
answers
198
views
Compose NavController is leaking
I add ComposeView straight to activity root (this is how I launch ModalBottomsheetLayout from xml view, example below is simplified but still reproducible)
Here is the whole fragment of reproducible ...
0
votes
0
answers
37
views
Is is possible to pass annotation class as a arguments to compose navigation?
Is is possible to pass this as an arguments to compose navigation?
Now I stil used navigation xml to change from page to another one
I would like to change to navigation compose but I am not sure that ...
2
votes
0
answers
43
views
Navigating to a top level destination doesn't save all toplevel states
Problem
There are three navigation graphs in my app as nested navigations : HomeGraph, ProfileGraph and MenuGraph. I want to achieve that when you navigate between these graphs through the ...
3
votes
1
answer
651
views
Kotlin Serialization: MissingFieldException with Navigation Component and Default Values
I'm implementing navigation in a Jetpack Compose app using the Navigation Component and experiencing serialization issues. I have two related problems:
When I remove default values from my User data ...
1
vote
1
answer
53
views
FragmentContainerview animation ordering with popUpTo and popUpToInclusive
This is the setup in the Main Activity:
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation....
3
votes
2
answers
663
views
Swipe right to navigate back in compose
In my Android app, I am displaying data in the lazy column, when the user clicks on one of the items in the list, it navigates to a new screen ("B") and when the user presses back it ...
2
votes
1
answer
112
views
Error "Type mismatch: inferred type is ... but TypeVariable(T) was expected" implementing navigation type safety in Compose NavHost
According to this post, starting with version 2.8.0-alpha08 of Navigation, objects can be used in navigation.
I'm trying to implement it, because I need to pass instances of an object called ItemUI ...
1
vote
1
answer
72
views
Controlling navigation from viewmodel
My NavHost and all of my navigation logic is in jetpack compose.
I was wondering, is there any way to navigate (using navController) to a certain page when my viewmodel initializes?
If that is not ...
1
vote
2
answers
1k
views
how to pass viewModel as parameter in NavHost compose navigation
I have to following NavHost:
NavHost(
navController = navController,
startDestination = Destinations.ComposeEntryPointRoute
) {
composable<Destinations.HomeRoute> {
HomeContent(...
0
votes
1
answer
254
views
How to Completely Hide the Back Button (Up Button) in a Toolbar in Android?
I'm working on an Android app with one MainActivity and three fragments. I've successfully disabled the back button (Up button) in the toolbar, but it still gets rendered in the toolbar. I want to ...
1
vote
1
answer
145
views
Infinite loop of recomposition if I add an if into a composable
A composable with a navhost is recomposing in an infinite loop if I add an if condition to navigate to a screen if a int parameter representing the current section has been changed. The condition has ...
0
votes
1
answer
114
views
How to create an Android Intent to the AMAP application with multiple waypoints?
How to create an Android Intent to open the AMAP application with multiple waypoints?
I tried this URI
// Create the URI for the Intent
String uri = "amapuri://route/plan/?dlat=destination_lat&...
1
vote
2
answers
249
views
No value passed for parameter 'route'
I am trying to learn app navigation with jetpack compose. I was reading and going through the documentation and code snippets and I came across this code here (Link).
In the documentation, they have ...
2
votes
0
answers
345
views
Jetpack Compose NavController with same route on multiple navigation graph
I've this situation:
Single NavHost and single NavController with this structure:
NavHost(initialRoute = "A"){
navigation(route = "A", initialRoute = "A1") {
...
1
vote
2
answers
106
views
Issue with androidx.navigation library and slash sign
Issue description:
When I try to create custom navigation type and navigate to certain destination in my NavGraph, I get error, which states, that this certain destination cannot be found in the graph....
0
votes
1
answer
28
views
What is the best way to force a subfragment to return to a root fragment after switching fragments using a navbar, and usng actions?
I am currently developing an android application (https://github.com/Team4388/ScoutingApp2025/) and I have recently swapped everything over to use sub-fragments and actions instead of enabling and ...
2
votes
1
answer
990
views
Typesafe Kotlin DSL NavGraph throws IllegalStateException
I am playing with the new Kotlin DSL Navigation Compose plugin, but I get an exception:
java.lang.IllegalStateException: Cannot find startDestination com.perissf.myapp.SignIn from NavGraph. Ensure ...
6
votes
2
answers
2k
views
Get current screen in Navigation Type-safety Jetpack Compose
Screens
@Serializable
sealed class Screen {
@Serializable
data object Home : Screen()
@Serializable
data class Profile(val name: String) : Screen()
}
Set up navigation
@Composable
...
1
vote
1
answer
311
views
Check login authentication using ROOM and COMPOSE
My application uses navigation in conjunction with room and compose, my problem is that when starting the app, a check is made in the local database and if the user has selected an option to remember ...
1
vote
0
answers
79
views
NavController.onGraphCreated throws java.lang.IllegalStateException
I am using the latest version of the Android Compose navigation library (2.8.0-beta04).
dependencies {
implementation "androidx.navigation:navigation-compose:2.8.0-beta04"
}
When I run ...
0
votes
0
answers
35
views
how to save fragments using jetpack navigation like other apps do
Jetpack-navigation works well and is responsive in most applications. For example, YouTube: When you go into it you see fragment container and bottom navigation. Inside the fragment container there ...
0
votes
0
answers
179
views
"Only once" vs "Always ask" on opening coordinates with Android app
Is there an API for opening coordinates in Android which would show the default? Something like:
Open with this app: "only once" vs "always" dialog which would show you all the ...
2
votes
1
answer
678
views
Can I use Shared Element Transition Animation in a Compose with Fragment Navigation
I am currently working on an Android project where I have implemented a FragmentA and a BottomSheetFragmnetB using Jetpack Compose. Both of these fragments utilize traditional Fragment Navigation ...
4
votes
1
answer
334
views
Is there a way to have dialog destinations in back stack when navigating to hosted destination in Compose?
I have a project where I have a mix of hosted destinations (screens) and dialog destinations (dialogs) in Compose nav graph.
Sample nav graph:
NavHost(
navController = navController,
...
1
vote
1
answer
50
views
Find an arrow in the fragment of an Android mobile application (Android Studio)
I'm currently developing an Android mobile application in Android Studio for a project aimed at creating an app that centralizes mini-games for playing online or locally. My project is progressing ...
0
votes
0
answers
399
views
Navigate from compose activity to a fragment of another activity
I am migrating an application from activities/fragments to compose screens. This means that I have to use the interop approach in the interim. I tried setting up navigation using Kotlin DSL. The docs ...
0
votes
1
answer
52
views
No exitAnim and popExitAnim when wrapping NavHostFragment in a AndroidViewBinding
I would like to begin by outlining my current app setup. It utilizes Jetpack Compose and wraps NavController with AndroidViewBinding, enabling me to employ the traditional method of navigation, which ...
1
vote
1
answer
106
views
Passing Bundle arguments to a fragment and invalidating arguments afterwards
I have two entry points into my fragment: one without passing a Bundle and a second that does pass a Bundle with an argument. I noticed, that once I've passed it an argument, the fragment retains that ...
0
votes
1
answer
127
views
How to navigate to root Bottom Navigation Menu Item on Android
I'm developing a Android app with Navigation Component with Fragments and a NavGraph.
My app has a BottomNavigationView with Menu Items like described in "Tie destinations to menu items"
...
1
vote
2
answers
608
views
How can I manage Jetpack Compose navigation during configuration changes?
I've encountered an issue where I'm using ViewModels for each screen to store inputs and variables. After implementing Jetpack Compose navigation, I noticed that it returns to the startDestination on ...
0
votes
0
answers
23
views
finish() not returning the intent to the previous activity which used startActivityForResult()
I have A, B, C,D as the activity in the current stack.
current stack -> |A|
I have launched B from A using startActivityForResult()
current stack -> |B|
|A|
Now inside of B I ...