1,341
questions
2
votes
1
answer
31
views
android jetpack compose, why the NavHost resulting in multiple navigations?
Here is a simplified sample which has ScreenNavHost contains NavHost with two route destination composable("userList") and composable("editLogin").
In UserListForm it has a button ...
0
votes
2
answers
38
views
What are the advantages of using Navigation comoponent along with Jetpack compose?
Is there a need for Navigation component with Jetpack compose? In Jetpack compose, we can move between composables function(screen level views) without needing Navigation component, so what is the ...
0
votes
1
answer
33
views
Firebase Crashlytics Navigation action/destination cannot be found from the current destination
I'm building my own app in Android
I'm using Navigation component to navigate between fragments.
It's logged IllegalArgumentException: Navigation action/destination cannot be found from the current ...
0
votes
0
answers
19
views
How to navigate between fragments present in different nav-graph in navigation component?
How to navigate between nav-graph fragments in android navigation component?
How can we use action of a global fragments and navigate to other nav-graph fragment?
How can we navigate from one nav-...
1
vote
0
answers
26
views
What's the best practice to set Navigation Graphs dynamically in Fragments?
I have a scenario where fragment0 contains a NavHost, and I dynamically set its navigation graph to include the flow fragmentA -> fragmentB -> fragmentC. Additionally, fragment0 is part of a ...
1
vote
1
answer
39
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
194
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
38
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
159
views
Navigate to any module from any module in 6 module multi module android project
I have 6 modules each module is kind of different app but i make 5 module as a library module and 6th module as the application module to launch activity and other
all module work on one activity and ...
0
votes
2
answers
50
views
Show/hide something after the fragment is completely visible on the screen - Navigation Component
I have a specific scenario:
I am developing a music player app and in it, I am using navigation component to move between different fragments (it's a single activity app)
So, I have a miniplayer in ...
0
votes
0
answers
51
views
NavController.OnDestinationChangedListener is not triggered during Navigation
In my project I have a simple Navigation Graph, **addOnDestinationChangedListener ** working fine but after the code click **addOnDestinationChangedListener ** is not trigger but navigation action did ...
0
votes
0
answers
39
views
How to force NavController#onGraphCreated to be called when calling setGraph twice with androidx.navigation 2.7.5
I'm using androidx.navigation:navigation-*:2.7.5 and noticed a potential issue with NavController#onGraphCreated not being called when calling setGraph twice. This seems to be related to the commit ...
0
votes
0
answers
40
views
Navigation component for fragments
There are in total 5 fragments: Home, Movie, TV, and Profile - part of the bottom navigation
Detail fragment - gives details for specific movie or TV series.
I was using a navigation component to ...
0
votes
1
answer
45
views
Pressing on BottomNavigationBar item always creates a instance, and also keep the old one in backstack
I am using Android navigation component and BottomNavigationBar for my application.
The Implementation
I have four tabs and i have created a separated navigation graph for each of my tab and 1 ...
0
votes
1
answer
82
views
App is crashing while trying to pass values from one screen to other
Project Overview
I am making an app, it is like a Pokedex . It can give detail to any of the pokemon you entered.
Problem
In that app only, there is a button as "Find Location" which is in ...
0
votes
0
answers
22
views
Navigation Component not popping the stack as intended
I have been encountering problems with the navigation component not popping the stack. This seemingly worked as expected until recently, the navigation-fragment and navigation-ui dependencies have not ...
0
votes
1
answer
165
views
Activity Deep Link - IllegalArgumentException: Required argument is missing and does not have an android:defaultValue
In my app I have the following structure:
<!-- AndroidManifest.xml -->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android....
0
votes
1
answer
64
views
Espresso check content of next fragment in AndroidX Navigation
I'm testing the login feature with Espresso and it's correctly working as long as I check that the navigation action would bring the user to the fragment ith correct id.
@Test
fun loginLogout() {
...
1
vote
0
answers
192
views
Deep linking in Compose Single Activity Architecture
Usecase: Single activity Compose app handling Firebase Auth magic email link.
Problem: if app is already opened and the user clicks the link, a new task is created and there are two instances of the ...
0
votes
1
answer
74
views
Fragment gets recreated on click from BottonNavigationBar with NavController
So I have a GoogleMap in Fragment A, whenever I select fragment B from the BottomNavigationBar and select Fragment A again, the Map is reinitialised. However, if I go back to fragment A by back-press, ...
0
votes
0
answers
108
views
Android-TV navigation component / custom menu doesn't get focus on app-start
Following problem: In my Android-TV-App I am using a custom menu, without leanback.
In my activity_main.xml I added two FragmentContainerViews (1x main_container, 1x settings_container) with each has ...
1
vote
3
answers
1k
views
Fragment not attached to Activity, How to solve?
I am using navigation component with bottom navigation view.
The issue is When I open the application the selected fragment is home fragment then when I navigate to another fragment(Favorite) and use ...
0
votes
0
answers
10
views
Android differentiate between navigate with argument and navigateUp
I am using the Android Navigation component moving from fragment to fragment in my app
So, I have a fragment defined something like this
<fragment
android:id="@+id/my_fragment_dest"
...
0
votes
1
answer
33
views
Using Fragment inside Navigation Fragment
Codes
Main Activity
// MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
0
votes
1
answer
69
views
Open application settings with Navigation Component
How to open application Settings page using Android Navigation Component?
I can open application Settings from code by sending Intent with URI of my application package name:
val intent = Intent(...
0
votes
1
answer
777
views
Fragment recreation issue with android Navigation component
Our project is using jetpact compose and navigation component .
We have 2 fragments- Fragment A & B . In Fragment A, UI is bit complex because of multiple elements like View Pager and lazycolumn. ...
0
votes
1
answer
30
views
DialogFragment exit animation showing empty white screen
I have a DialogFragment with this code in order to animate when it exits:
override fun dismiss() {
dismissListener?.invoke()
exitAnimation?.let {
val animation = ...
0
votes
0
answers
34
views
How can I reach the login screen from inner nav file
I'm a rookie in Kotlin and Android.
My application has two different navigation structures. The first one is a navigation file named main_activity_nav, which contains splash, login, signup, and main ...
0
votes
1
answer
133
views
Go back to previous screen by clicking on bottom navigation bar item
Using Navigation Component, Bottom Navigation Bar XML. I set up a navigation graph in which I nested another navigation graph called Home and set it to the first tab at the bottom navigation, if I go ...
0
votes
0
answers
50
views
Reselecting a tab on bottom navigation clearing stack while using navigation component
Have 4 fragments A,B,C,D in my bottom navigation setup with navigation component with A fragment as home destination , when I navigate from A to another fragment say fragment E with findNavController(...
2
votes
1
answer
2k
views
How to populate SavedStateHandle with navigation arguments in instrumentation test using Hilt and Jetpack Compose
I'm using a combination of Compose, Navigation, ViewModel and Hilt with SavedStateHandle to access nav arguments within the ViewModel. Everything works well together, however I've run into an issue ...
0
votes
1
answer
140
views
Need to use handler.postDelayed returning from a DialogFragment using navigation component return with a boolean argument
I am using Navigation component to launch & dismiss an ErrorDialog. I noticed that when I try to re-open the error dialog on a re-try flow I get an error that the action can't be found. It works ...
0
votes
0
answers
383
views
Updating item in recyclerview, automatically updates viewmodel values even when it must not update - Navigation component
I am facing a weird problem in my application.
Basic structure of the app is that I have one MainActivity and that has many fragments. Using Navigation component (Sigh! why did I use that).
There's a ...
0
votes
0
answers
45
views
Navigation component: When using FragmentContainerView, TopLevel destination fragment not showing Hamburger (Drawer) icon
I have an app in which I am using Navigation component with nav_graph. The problem I am having is that Hamburger Icon (also known as Drawer Icon) isn't showing up.
I am following this documentation - ...
0
votes
0
answers
46
views
How to Not to Save State in Latest Navigation Component Android Library - Java
Component used: Navigation
Version used: 2.5.2
I would like to know if there's a way to stop saving states of different navigation views in the latest navigation library. As this is a default behavior ...
0
votes
1
answer
323
views
Hilt Navigation Compose makes TopAppBar starts flickering
In my project I'm using:
implementation "androidx.hilt:hilt-navigation-compose:1.1.0-alpha01"
Inside onCreate() I use:
setContent {
val navController = rememberNavController()
...
0
votes
1
answer
72
views
Android navigation drawer layout menu item fragments not getting added to back stack
I've got a bug that I think may be unsolvable. I'm not sure what I am doing wrong; and I suspect that perhaps I am not doing things in the correct, 'android' way.
I have a single activity app with ...
0
votes
1
answer
26
views
I can't back press between fragments when clicking back press button
I am implementing an android application in kotlin and i can't navigate back between fragments and i get warning like :
Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=...
1
vote
0
answers
38
views
Navigation Component implicit deeplink with backstack
I have three screens. A, B and C.
A -> B -> C
What I want is that when I navigate to C with implicit deeplink (e.g. with a url), when back button is pressed, app goes to B, not A.
2
votes
0
answers
591
views
How to navigate to a specific destination via deep link without adding any other destination in the backstack
Suppose I have the following setup:
nav_graph_a.xml
Fragment A (start destination)
includes nav_graph_b
nav_graph_b.xml
Fragment B (start destination)
Fragment C (has a deep link to it)
And an ...
0
votes
0
answers
434
views
Prevent API call and data refresh when navigating back using Navigation Component in Android
I have an Android project where I'm using the Navigation Component to handle fragment navigation. In one of my fragments, I'm making an API call to fetch data and displaying it in the UI. However, ...
1
vote
0
answers
28
views
Navigation Component with ContextMenu
I've a MainActivity linked with navigation component. Every fragment has its own implementation of Toolbar and I setup it, calling this method defined in the activity, from the specific fragment:
fun ...
0
votes
0
answers
109
views
Android - Navigation component with bottom tabs - Navigating from TabA to TabB programmatically
Context
The app operates on a single activity, with bottom tab navigation within it.
I have a button from "Home" tab, that when clicked, leads to TabB with arguments (to be used for ...
1
vote
1
answer
533
views
Android Navigation Component load 2 nested Fragments into Parent Fragment
I have a Comparator Screen which is a Fragment that is splitted into 2 sub-screens. Before using Navigation Component I could easily just:
private void initializeFragments() {
...
1
vote
2
answers
436
views
How is safe args in navigation component type safe (Android)?
In a normal fragment transaction we would pass data as:
Fragment fragment = new Fragment();
Bundle bundle = new Bundle();
bundle.putInt(key, value);
fragment.setArguments(bundle);
Isn't this type ...
9
votes
1
answer
2k
views
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 ...
0
votes
0
answers
150
views
Android Navigation Component: Fragment with attached listener object
I have Fragment B
class FragmentB : Fragment() {
private var myListener: MyListener? = null
... //onCreate and other methods
...
fun setListener(listener: MyListener) {
...
1
vote
1
answer
4k
views
Bottom navigation bar appears above modal bottom sheet in jetpack compose
I have post in this post I have icon for comments when the user click on it, it should open modal bottom sheet but the problem is Bottom navigation bar appears above modal bottom sheet in jetpack ...
0
votes
2
answers
384
views
Can i obseve fragment scrolling in activity?
I structured it like this:
FragmentContainerView in Main activity
ViewPager2 in HomeFragment
Nested scroll view / recycler view in ViewPager2 fragments
I want to set the visibility for a button in ...
2
votes
1
answer
5k
views
How to pop up to start destination (Compose Navigation)
I'm using the Navigation Component for Jetpack Compose.
I'm having troubles in clearing my backstack to contain only the starting destination when I navigate.
For example, if I have 3 screens A, B, C ...