Questions tagged [android-navigation-graph]

303 questions
0
votes
0 answers

Android Deeplink not working from notification

I'm attempting to trigger a specific tab to open with some data on notification press. The way the notification is setup is it open the root page if the user clicks the notification itself and a specific page if they click a button on the…
0
votes
1 answer

Android Navigation Safe Args Pass LiveData and Lambda Variable

I have two questions for a simple Fragment A -> Fragment B graph: Can I pass LiveData using safe args? If not, how can I listen the value changes in Fragment B from Fragment A? Can I pass lambda varible (function) using safe args (to act like a…
0
votes
1 answer

Issue with the Navigation Click Handler - JETPACK - KOTLIN

I am using the Navigation functionality of the JetPack library. Included Two Fragments in Navigation Graph. Have to navigate from TitleFragment to GameFragment with the click of the button which is inside TitleFragment. I have done as below inside…
0
votes
0 answers

How to restore fragment when backpressed

I'm using navgraph with some fragments Fragment A --> Fragment B --> Fragment C as the navigation. When I navigate from Fragment A to Fragment B and press back, I see onCreateView and then onViewCreated is called again in the Fragment A which…
0
votes
0 answers

Fragment layout not showing after opening through bottom sheet

I am using navigation component to work with lets say fragmentA, bottom sheet(dialog), fragmentB. fragmentA has a button which opens bottom sheet, and bottom sheet also has a button which will open fragmentB. Now as I am using navigation component,…
0
votes
1 answer

How do you pass data to a start Fragment from a destination Fragment's FloatingActionButton's OnClickListener when using a NavController?

I am trying to pass data from a destination Fragment's FloatingActionButton's OnClickListener to a start Fragment while using a NavController. The FloatingActionButton is in the Activity hosting all the Fragments. Currently, I can return to the…
John Glen
  • 771
  • 7
  • 24
0
votes
2 answers

Onbackpress using navigation graph

I have 5 fragment as follows: But I want when I am on 5th fragment, when I press back button it returns to 2nd fragment. So how do I do it while I use navigation graph
Thang
  • 409
  • 1
  • 6
  • 17
0
votes
0 answers

How display toast when back button of navigation graph clicked

In the fragment whenever I click the back button of the provided in navigation Graph the application crashes. what I really want to implement is to display a dialog box that will say yes then will move to the previous fragment and if it says no then…
Garvit
  • 94
  • 11
0
votes
0 answers

To many arguments when using android navigation safeArgs

i am creating navigation graph in android, and i give args for the destination, but when I called the function, it was saying too many arguments. already setup on build.gradle (app) apply plugin: 'androidx.navigation.safeargs' already setup on…
0
votes
1 answer

Android Navigation Component navigate to previous fragment

I am using Navigation Component to navigate through pages in my app. I have a ProfileFragment and users might navigate to this fragment from different fragments(like HomeFragment, ArticleFragment, and ...). In my ProfileFragment how should I know…
0
votes
0 answers

NavigationUI.navigateUp does nothing

I have an Activity, where I have a fragment, in which I have referenced a Navigation Graph component: activity XML:
0
votes
1 answer

Tap on notification to open app destination with Navigation component, incorrect destination

I am trying to open a specific destination in my navigation graph from a tap on notification. I created Pending Intent as follows- //this code in service to create notification OccasionViewerArgs.Builder builderArg = new…
0
votes
1 answer

Login to BottomNav

The app I'm developing is going to start with a login, which will be two different screens. After successfully logging in, the user will be redirected to a screen that will have a bottom navigation. What is the "proper" way of going about this? …
0
votes
0 answers

NavDeepLinkBuilder arguments bundle not received in destination fragment

I have 2 nav host activities Activity A and Activity B with each their own set of navigation graphs. I want to navigate from FragmentA which is in a nav graph hosted by Activity A to FragmentB which is in a nav graph hosted by Activity B to…
0
votes
1 answer

Problem going back from current Fragment back to the replaced Fragment when using NavHostFragment

I have three fragments A, B and C. And I'm using navHostFragment container in MainActivity. So the application goes from A -> B using kotlin extension function findNavController().navigate... and then go from B to C using same function. All works…