Questions tagged [android-jetpack-navigation]

0
votes
0answers
8 views

How to fix safeguards error about Direction's class action setter not generated by android studio?

I am new to jetpack in android and develop apps in java or sometime in kotlin setter is not generated in action's name method of direction class for setting arguments value , even after rebuilding ...
3
votes
0answers
34 views

How to (proper) open Activity/Fragment from Foreground Service using Navigation Components

In my use case, I have a Foreground Service bounded to a Notification. The user can kill the app but the Foreground Service is still alive. Additionally, the user can click in the Notification and ...
0
votes
0answers
38 views

Scoping a viewmodel to multiple fragments (not activity) using the navigation component

I'm using the navigation component, I want a view model to be shared between a few fragments but they should be cleared when I leave the fragments (hence not scoping them to the activity) I'm trying ...
0
votes
0answers
12 views

Disabling animation when using Navigation Component together with BottomNavigationView

How can I disable/change the fading animation when using Navigation component together with BottomNavigationView? My code to set them up together (in the activity) is as follows: private fun ...
0
votes
1answer
27 views

How to set and retrieve arguments set in NavGraph.xml?

I know the Android developer articles about Android Navigation: https://developer.android.com/guide/navigation/navigation-pass-data and https://developer.android.com/guide/navigation/navigation-...
0
votes
1answer
18 views

How to hide the bottom navigation bar in certain fragments?

I have An activity with a navGraph and a bottom Navigation bar with 2 menu items. My problem is that My Bottom Navigation Bar appears everywhere, detailFragment, aboutFragment, signInFragment and so ...
1
vote
0answers
35 views

Upgrading Jetpack Navigation causes compilation error to other libraries

I was trying to upgrade Jetpack Navigation (Plugins(safeargs) and libraries(fragment,UI,)) from android.arch.navigation:{library-name}:1.0.0-alpha06 To androidx.navigation:{library-name}:2.0.0 ...
0
votes
0answers
34 views

OnBackPressedCallback not called when comes from a notification

I am using navigation and app-compat libraries to manage app navigation. But, for a specific case, I need to override back navigation with OnBackPressedCallback. If I navigate to a details fragment ...
0
votes
0answers
62 views

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'...
0
votes
1answer
22 views

Navigation View Global Action Back State

I have been messing with the Jetpack Navigation component, and I created an activity that uses a navigation drawer. class MainActivity : AppCompatActivity() { override fun onCreate(...
0
votes
1answer
34 views

How to pass data from the navigationdrawer to Activity using safe-args?

Let's say we have a project like this one: class MainActivity : AppCompatActivity() { private lateinit var drawerLayout: DrawerLayout private lateinit var appBarConfiguration : ...
0
votes
0answers
23 views

Unable to move from parent to child host in navigation nested graphs

I have two navigation graphs main_nav_graph.xml and nav_graph.xml. main_nav_graph is the root graph which has two fragments Sign_in and Sign_up. Now I want to navigate from Sign_in fragment to ...
2
votes
1answer
77 views

Jetpack Navigation Deep Link with wrong ActionBar button

When I open my application from the launcher icon, all the Navigation and ActionBar button works fine. But when I access the application from an explicit deep link, my ActionBar gets confused. My ...
0
votes
2answers
29 views

Updating NavDestination label at runtime

I can not update NavDestination's label at runtime. it reflects but not from the first time i enter the screen, it doesn't reflected instantaneously My ViewModel class PrepareOrderDetailsViewModel( ...
0
votes
1answer
75 views

android navigation component up button, arrow displays but popTo not working

I'm using the jetpack navigation component with a very simple set up, one activity (MainActivity) and 4 fragments MainFragment, CardPreviewFragment, createCardFragment, and ...
0
votes
0answers
16 views

How does the new navigation component work with FragmentPagerAdapter

I started using the navigation component in our app. It works pretty well at most parts. However, I'm not sure how to integrate it with FragmentPagerAdapter since FragmentPagerAdapter does its own ...
0
votes
0answers
36 views

Set Subtitle of Toolbar with JetPack Navigation Architecture Components

I'm using the JetPack Navigation Architecture Components and I can set the title of the Toolbar in my Navigation Graph with android:label="@string/event_lists_toolbar_title". I would also like to set ...
0
votes
0answers
106 views

Fragment XXX {} not associated with a fragment manager

I started using navigation component in my application and I am facing with the following problem. My first fragment is LoginFragment. After a success login, the mainFragment is displayed. I want ...
0
votes
1answer
31 views

how to add both bottom navigation and navigation drawer in an android app

Currently I have three options in my bottom navigation and a navigation graph for them. part of my mainActivity.xml file look like this: <fragment android:id = "@+id/nav_host_fragment" ...
0
votes
1answer
62 views

Display back button on toolbar on first screen of navigation graph

I'm trying out androidx navigation component and have setup my activity with a toolbar a container. I'm doing this in one of the intermittent screens of my app which has a lot of internal navigation/...
0
votes
0answers
51 views

DataBindingUtil plus NavHostFragment back navigation not working

I had posted a question earlier regarding NavHostFragment not working on back press. The question was not answered by anyone, hence putting a couple of days effort into it, I finally managed to figure ...
0
votes
2answers
107 views

Android Navcontroller hardware back button crash

I am using new android storyboard to create an application. The flow need to be like following: SplashFragment -> Fragment1 -> Fragment2 Following is the storyboard(navigation_main.xml): <?xml ...
1
vote
1answer
70 views

BottomNavigationView with Navigation Editor facing issue of fragment not changing

I am trying to use BottomNavigationView with Navigation Editor. I have implemented everything as given but only home page is showing, when I change the tab, it does not change the fragment. This is ...
0
votes
0answers
39 views

Destination has changed on back press, but previous fragment still remains on UI

My app is a single activity application that uses Android Jetpack, I have the following lines of code in my fragment's onViewCreated(): requireActivity().addOnBackPressedCallback(...
0
votes
0answers
36 views

Android Navigation Components

I added Android new Navigation Component inside my app and created navGraph and added few fragments as a destinations. I figure out every time i navigates into destinations previous destination (...
0
votes
1answer
35 views

How to prevent Navigation when using Android Jetpack Navigation

I want to check the actual Fragment if it's dirty and warn the user to lose his changes. I could'nt find an Listener on the Navcontroller to interact before the navigation happens. I already tried to ...
0
votes
0answers
12 views

How to connect authentication logic on my project with navigation library? Nested Navigation Graph

I make a football match schedule table application. My scenario is: User first authenticate my app. Example, I have 3 Auth steps, the user must do those 3 steps. My app launches with the user auth ...
0
votes
0answers
64 views

ClassNotFoundException: Didn't find class “androidx.navigation.NavController$OnNavigatedListener”

When i try to setup the navigation graph to my application i am getting this error: LogCat: 2019-04-05 11:56:35.949 16357-16357/com.example.supplier E/AndroidRuntime: FATAL EXCEPTION: main Process: ...
-1
votes
1answer
120 views

Android Navigation Component + Login Flow + Nested BottomNavigationView

I'm struggle building a Navigation, like on the image below, with the Android Navigation Component. I need a "Login Flow", check if the user is logged in and then navigate to the main part of the ...
0
votes
1answer
96 views

Android Jetpack Navigation - Notify Bottom Nav View of Correct Item

I'm running into an issue where the navigation UI doesn't select the correct bottom navigation view item WHEN DEEP LINKING to a 2nd level fragment. Here's what I mean: select fragment_reading_lists: ...
0
votes
1answer
45 views

How can i customize setupActionBarWithNavController animations?

I can customize android navigations actions easily, like this code, but I am not able to customize actions coming from drawer or bottomnavigation and menu. Is there a way to customize this actions? ...
0
votes
0answers
28 views

Error finding NavController in MainActivity

I recently updated version 2.0.0 of Navigation Architecture Components and have been facing error in finding the NavController in the MainActivity of my app. I have tried finding the NavController ...
1
vote
1answer
93 views

Is there a way on the new navigation component on back pressed to restore the state on recyclerview

What I'm using: MVP Navigation Component Single Activity Fragments RecyclerView Realm Problem: I have a MainActivity that hosts all the fragments for the application flow. There's one fragment ...
0
votes
0answers
33 views

How to add NavDestination to NavigatorProvider?

The extension function of package androidx.navigation have plusAssign, therefore it is equivalent of += but in my code it doesn't find the plusAssign. class MyNavHostFragment: NavHostFragment() { ...
2
votes
1answer
93 views

Achieving proper scrolling with RecyclerView, android jetpack navigation and a collapsing Toolbar

I try to implement proper scroll behaviour with the following setup in my android application. For navigation I use the jetpack navigation in combination with a Toolbar layout and a bottom ...
0
votes
0answers
21 views

How to have FragmentNavigation#navigate() behavior with FragmentTransaction#add() instead of #replace()

I am working around to preserve the view (without storing as local variable) of fragment and in current Navigation Component it looks certain that onDestroyView() is called, I want to avoid calling ...
0
votes
0answers
50 views

How to use navigation using TabLayout

I am creating the below view. I am trying to use Jetpack's Navigation. I created navigation and put all the required fragments in it. While clicking on each tab, I have to load the respective fragment....
7
votes
2answers
892 views

Fragments destroyed / recreated with Jetpack's Android Navigation components

I'm trying to implement Navigation with Jetpack's architecture components in my existing app. I have a single activity app where the main fragment (ListFragment) is a list of items. Currently, when ...