37 questions
0
votes
0
answers
5
views
Fragment Container View Loose NavGraph
I have a function to create a new bottom sheet dialog in my main activity which contain a fragment container view to display a nav graph.
private fun showBottomSheet() {
// Create the ...
0
votes
0
answers
20
views
Reuse the same fragment in multiple navigation options of the same graph
I have a BottomNavigationView linked to a nav_graph.
I want that all my BottomNavigationView options open the same fragment. The option ID is used in the Java code to determine what to show in the ...
0
votes
0
answers
17
views
Nav graph vs Fragment class navigation issue
We're using nav graph in our application.
As an requirement, we've a new Fragment class provided by some third party sdk. We wanted that fragment to use when it's accessible along with nav graph.
Will ...
0
votes
1
answer
23
views
How to skip SearchView in back stack of navigation controller?
The call docPageSearchView.show() opens SearchView. Then, pick an item from the search result and open a new instance of the same fragment to display the new content ("viewer fragment"). Now,...
1
vote
1
answer
109
views
Compose Navigation - Incompatibility and workaround with Serialized Objects
I have a project where I am using the material 3 top app bar. Naturally when I am on my home page, I want to hide the back button since there is nothing on the backstack. However, I am not using ...
0
votes
0
answers
25
views
How to synchronize DeepLinks between navgraph.xml and my Kotlin DeepLink generator in Android?
In my Android project, I’m using a DeepLinkGenerator class to centralize all DeepLink URIs for navigating between fragments. The DeepLinks are also defined in navgraph.xml. My goal is to ensure that ...
0
votes
0
answers
41
views
Search result returns empty list(args wasn't passed to Nav correctly)
I have been working on a notice app based on the Inventory App(Tutorial App that Android Studio provides in their CodeLab). I tried to add a searchbar in Homescreen so that the users can search items ...
0
votes
1
answer
48
views
Jetpack Compose NavGraphBuilder uses composable as a method parameter. How?
This is from an Android compass app project at https://github.com/AkarshGuptaa/Compass.git which compiles and runs without bugs
I'm wanting to know how compassComposable: @Composable () -> Unit is ...
0
votes
0
answers
35
views
Best Practice of using Navigation Component. Activities only or only Fragments or Both of them together?
I am working with Navigation in android and multiple questions came up:
If an android application only consist of activities, is it good practice to make NavGraph for activities?
Or NavGraph should ...
0
votes
0
answers
29
views
Navgiation Component nested graph backstack issue with bottom navigation
Navgiation graph skeleton below:
MainActivity
|- RootNav
|- HomeNavGraph (RootNav's startDestination) (bottom nav tab 1)
|- HomeFragment (HomeNavGraph's startDestination)
|- ...
1
vote
0
answers
54
views
Error when navigating from a DialogFragment in Android using the navGraph
I want to navigate from a DialogFragment using the navGraph. For that I have onClick methdod that triggers the navigation in the DialogFragment
public void onClick(View view) {
if (view instanceof ...
0
votes
0
answers
23
views
Restricting back navigation from nested nav graph
I will give simplified version of my issue. I have 2 fragments. MainFrag, LoginFrag. Both are contained inside their seperate nav graph. mainGraph, loginGraph respectively (please excuse naming ...
0
votes
0
answers
77
views
Crash when navigating between fragments using app:navgraph in Android
My app is crashing randomly with the following error response. It shows a crash on this XML code at line number
app:navGraph="@navigation/nav_radio" this.
<fragment
android:id=&...
0
votes
1
answer
28
views
Android conditional remove fragment from back-stack using Navigation Components
In an Android APP I have the following navigation using Navigation Components and Nav Graph:
Fragment A -> Fragment B -> Fragment C -> Fragment D -> Fragment E
Anyway the back navigation ...
0
votes
1
answer
307
views
Navigation issue from a Fragment. Android
I'm facing an issue with Android Navigation Component. I have set up a NavHostFragment in my app, and I'm trying to navigate from one fragment to another using Navigation.findNavController(view)....
0
votes
0
answers
53
views
Navgraph isn't allowing me to go back to the previous shown destination
I'm currently organizing my NavGraph to have a more logical structure in a way. So I have a NavGraph that looks like this:
Previously, I set my starting destination to Monitoring, now I set it to ...
0
votes
0
answers
30
views
Naviagtion XYZ cant be found from current destination()
I often get this error a lot in all my projects
Navigation action/destination com.speakerbooster.volumebass.equalizersound.amplifier:id/action_premiumFragment_to_dashboardFragment cannot be found from ...
0
votes
0
answers
34
views
Pass items from recycleView to another recycleView in Kotlin
I am newbie Kotlin programmer. I used Notes tutorial to create a recycle view with add button.
In this tutorial he used MVVM pattern design. (model,ViewModel,Repository, and Firebse) NavGraph also ...
0
votes
1
answer
54
views
Can not find NavController set
I am trying to navigate between fragments, however when I try view.findNavController in the host fragment (login fragment) inside onViewCreated I face this error:
java.lang.IllegalStateException: View ...
1
vote
0
answers
1k
views
How to add Transition animation in android jetpack Compose Destination library?
I have started learning Android Jetpack Compose and I come across Compose Destination library which is the best for navigation. But now I am stuck on the navigation transition part where I want to ...
0
votes
2
answers
456
views
Send call back to previous fragment with data using navigation graph
I am using navigation graph for the first time so need help regarding the same.
In my application I have MainActivity with 5 nested graphs.
<?xml version="1.0" encoding="utf-8"?&...
0
votes
1
answer
108
views
Back Navigation Issue (Nav Graph) Issue (android)
I am stuck in this issue of back navigation button for long while, I have tried different methods but still the problem is not resolved
Here is the IMAGE
This is my issue
So, I have a home ...
0
votes
0
answers
57
views
String value passed as default argument received as a number in fragment args
Value passed as String should be received as String
Steps to reproduce:-
Fragment needs to be added as startDestination in NavGraph
Add a default argument in fragment of string type and default value ...
5
votes
0
answers
499
views
IllegalStateException: Restore State failed: destination Fragment2 cannot be found from the current destination Fragment4
I am using the Jetpack Navigation library, Graph A is a graph similar to Login, where Graph B is the main content containing a BottomNavigationView, the problem occurs in one scenario only.
User is ...
0
votes
1
answer
829
views
Some Navigation Graph Actions Are Not Resolved
I have multiple nav graphs in my projects each has multiple actions defined.
Lately, I am getting this error while Building the app preventing me from generating APK
Unresolved reference: action...
...
0
votes
1
answer
87
views
Unable to Redraw NavGraph Fragments Using setGraph()
How can I force Navigation Components to redraw the fragments inside a navGraph from scratch?
I've tried using setGraph() with the same instance of the navGraph, but it only works the first time. The ...
0
votes
1
answer
625
views
NullPointerException: null cannot be cast to non-null type kotlin.Int. When calling navController.setGraph after restarting Activity
Sometimes, the setGraph function causes a NullPointerException: null cannot be cast to non-null type kotlin.Int. It depends on how I restart the application.
When MainActivity is created, it ...
2
votes
0
answers
42
views
can we combine multiple activities in single navGraph ? if yes then How we can use multiple activities in single Navgraph?
How to use multiple activities in single Nav graph ? is it possible to use multiple activities in single NavGraph.
2
votes
1
answer
478
views
Difference between Navigating one fragment to another using fragment id and action id using nav graph in android jetpack library
I am using jetpack navigation graph in my android project. Normally to navigate one to another fragment we connect a link between them in nav graph and call like this
findNavController().navigate(R....
0
votes
2
answers
2k
views
java.lang.IllegalArgumentException: Navigation action/destination
I'm building a notes application. I want to save the note when user press the back button from the createsNotesFragment and finish the createNotesFragment so that I can move to the homeFragment.
The ...
0
votes
1
answer
475
views
how to change the fragments using nav controller?
i am using navigation drawer with navigation components the problem i am facing is navigation is not working i have two fragments dashboard and profile but its not navigation to profile fragment.
here ...
2
votes
2
answers
101
views
Start activity with either of two fragments
I have an activity and used a navgraph to navigate through three fragments. This goes from Fragment1 to Fragment2 to Fragment3 and it works.
However, from Fragment3 I start a new activity. In this ...
1
vote
2
answers
1k
views
Android navigation component & Bottom nav view - Hard back button goes back to "Home" with non-saved state
Context
We're migrating to use the nav component in my company, and its going ok so far.
We have a bottom navigation view with 5 tabs, and using the NavigationUI to set it up.
We have "Home" ...
0
votes
0
answers
194
views
How to use Navigation graph for Activity?
As we all know navGraph contains fragments screen and strings(action) that connect two fragments, this navGraph can be hosted on NavHostFragment inside an activity XML.
So in the same fashion can we ...
2
votes
1
answer
830
views
How to navigate from DialogFragment to DialogFragment?
I have a fragment where I click a button and it opens a dialog(DialogFragment). In this dialog, i have a button that if I press it, I want to dismiss this dialog and open another different dialog(...
0
votes
1
answer
525
views
How to call another navgraph fragment from another nav graph without lossing current destination in andorid
I have Two navgraph inside my project
graphA {
I have some fragments inside my ( Graph A )
login fragment ( this fragment set as home ) and
signup fragment
}
graphB {
I have some fragments inside my ...
0
votes
2
answers
1k
views
Android - NavGraph without a startDestination
How can I have a navGraph without a startDestination?
I have a BottomSheet fragment container. When some events are triggered I want to expand this BottomSheet and load a fragment to its fragment ...