Questions tagged [android-navigation-graph]

303 questions
3
votes
0 answers

Jetpack Navigation Graph Fragment lifecycle

I have created a project with Jet-pack Navigation graph. In my project everything is working fine. But I am facing a problem that Suppose that We have 2 three fragment A and B. In Fragment A in the onViewCreated() method i call a API. Now I move…
3
votes
0 answers

Dynamic navigation with Nav Graph

I've a survey with an undefined number of questions: each time I give an answer, the server respond me back with the new one. Questions are "dynamic", in the sense that the next question depends on the current answer. I've a finite number of…
3
votes
2 answers

BottomNavigationView icons not highlighted with Navigation 2.4

I updated to Navigation 2.4 (def nav_version = "2.4") and now when tapping on a BottomNavigationView item it does not always highlight the icon or show the fragment the BottomNavigationView item id points to. There are 3 bottom navigation tabs…
Ben
  • 3,346
  • 6
  • 32
  • 51
3
votes
2 answers

Android keep software keyboard open when moving to next fragment inside Activity

I have some strange requirements where I have to keep the keyboard open when moving to the next fragment in the user onboarding flow. I tried to implement that using one invisible EditText inside the parent activity layout file and requesting focus…
3
votes
0 answers

Pass data to a Fragment launched from the Navigation Drawer using Navigation Destination Arguments defined in the navigation graph

When using Navigation Architecture Components and when launching fragment from the navigation drawer you use Menu and navigation graph where for example the menu below which is for navigation drawer called "drawer_menu"
3
votes
2 answers

How to get a result from Activity to Fragment With Navigation Component?

I have MainActivity, ProductListFragment and ProductDetailActivity. ProductListFragment is a start fragment. when I click a item of list in ProductListFragment, it goes to DetailActivity with action that i set in nav_graph. val action =…
3
votes
2 answers

Is there a way to tell manifest merger not to add path data to intent-filter

I'm using navigation component and navigation graph for handling deeplinks. I've added deeplinks to my destinations like below Intent Filter documentation mentions: If a filter specifies a scheme and an…
3
votes
1 answer

fragmentDirections.action() method can't find arguments specified on nav_graph

I'm trying to implement the Safe Args plugin, but my auto-generated class/method MainScreenFragmentDirections.actionMainScreenFragmentToNoteScreenFragment() can't seem to find the specified arguments from the nav_graph. I don't think the problem is…
3
votes
1 answer

Individual Navigation graph for each Bottom navigation view menu item - Android

My application contains a bottom navigation view with 3 menu items in the main activity, each menu item inflates respective navigation graphs in the navigation container view. Each graph has 2 or more fragments connected via actions. The problem…
3
votes
2 answers

Opening activity inside a navgraph with a deeplink causing a crash

I have an activity inside an navgraph, directly i am able to navigate to it by below code Navigation.findNavController(requireView())?.navigate(R.id.sampleActivity) Please find the navgraph below
3
votes
1 answer

When I add the same fragment to second navigation graph, don´t recognize the Action Class

I need to add the same fragment to different navigation graphs. This is piece of code of first graph (mobile_navigation)
3
votes
1 answer

Is it possible to inflate a view that contains `FragmentContainerView` inside a `Fragment`?

I'm trying to inflate a view that contains FragmentContainerView inside a fragment that's being put into a layout. RootView Fragment CustomView FragmentContainerView Like this: val transaction =…
3
votes
0 answers

Trying to execute a method using NavGraph when a Drawer Navigation item is clicked

So i am using a Navgraph to set my drawer navigation destinations and I want to know how I can execute a method when a menu id is clicked by using a NavGraph instead of doing NavigationView.setOnNavigationItemSelectedListener and then if/else…
3
votes
4 answers

FragmentContainerView and app:navGraph - This navigation graph is not referenced to any layout files

To prevent Lint warning (replace fragment with FragmentContainerView) after upgrading to latest fragments (1.2.2 version) and navigation (2.2.1 version) I replaced fragment with FragmentContainerView
3
votes
2 answers

How to use a shared ViewModel, and avoid reusing the same instance of it every time with Navigation Component

My app consists of one single Activity with multiple Fragments, following the "single Activity app model", so that I can implement properly navigation using the Navigation Component in Android jetpack. Most of my screens (Fragments) are standalone…