I have a single Activity
application. I created a single Navigation graph
containing all the possible destinations (Fragment
).
The Activity
layout
only contains a <fragment/>
container as it should be.
There is a main Fragment containing a BottomNavigationView
where the user can navigate to all the important destinations (3 of them).
When I implement the BottomNavigationView
as described in many tutorials or event in the official documentation, it replaces the full content of the Activity
. Therefore, the BottomNavigationView
is no more displayed as it is contained in a Fragment
and not in the Activity
. I want it to inflate the right layout
in the main Fragment.
Should I use another Navigation graph
, specific for the main Fragment ?
Should I use a classic Listener
(But I will loose all the interest of using a Navigation graph
) ?
Is there a solution I don't know ?
How do I implement it ? I tried to create two different Navigation graph
, but I can not set it to my BottomNavigationView