Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add new fragment in the root of mobile_navigation #3

Open
sinhpn92 opened this issue Aug 29, 2020 · 0 comments
Open

How to add new fragment in the root of mobile_navigation #3

sinhpn92 opened this issue Aug 29, 2020 · 0 comments

Comments

@sinhpn92
Copy link

Hi,
Your repo so greate. But, I'm looking for the solution to add a fragment which have same level with form, home, list.
That's mean the application have the main screen is the same with the current repo. I need more fragment like that:

<navigation
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/app_navigation"
    app:startDestination="@id/home">

    <include app:graph="@navigation/home" />

    <include app:graph="@navigation/list" />

    <include app:graph="@navigation/form" />

    <action android:id="@+id/action_open_detail"
        app:destination="@id/nav_detail"/>

    <fragment android:id="@+id/nav_detail"
        android:name="com.example.android.navigationadvancedsample.detail.Detail"
        android:label="Detail"
        tools:layout="@layout/fragment_detail"/>

</navigation>

I want to open the detail screen in the tab screen and I will be hide the bottomnav when open the detail screen from any tab by handle destination changed.
Howerver, I navigation by findNavController().navigate(R.id.action_open_detail). But I have got error: navigation destination com.example.android.navigationadvancedsample:id/action_open_detail is unknown to this NavController

Have any suggest to open detail nav?

Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant