I need to add the same fragment to different navigation graphs. This is piece of code of first graph (mobile_navigation)
<fragment
android:id="@+id/nav_contactanos"
android:name="com.engie.mexico.micuenta.Fragments.FragmentContactanosCliente"
tools:layout="@layout/fragment_contactanos_cliente" >
<action
android:id="@+id/action_nav_contactanos_to_nav_aviso_privacidad"
app:destination="@id/nav_aviso_privacidad" />
<action
android:id="@+id/action_nav_contactanos_to_nav_terminos_condiciones"
app:destination="@id/nav_terminos_condiciones" />
<action
android:id="@+id/action_nav_contactanos_to_nav_mensaje_usuario"
app:destination="@id/nav_mensaje_usuario" />
</fragment>
The second fragment of code in second navigation graph (navigation_inicial)
<fragment
android:id="@+id/nav_contactanos_cliente"
android:name="com.engie.mexico.micuenta.Fragments.FragmentContactanosCliente"
tools:layout="@layout/fragment_contactanos_cliente" >
<action
android:id="@+id/action_nav_contactanos_cliente_to_nav_mensaje_usuario"
app:destination="@id/nav_mensaje_usuario" />
<action
android:id="@+id/action_nav_contactanos_cliente_to_nav_terminos_condiciones"
app:destination="@id/nav_terminos_condiciones" />
<action
android:id="@+id/action_nav_contactanos_cliente_to_nav_aviso_privacidad"
app:destination="@id/nav_aviso_privacidad" />
</fragment>
When I try to MakeProject, the build output shows me the error :
C:\Android\MiCuenta\app\src\main\java\com\engie\mexico\micuenta\Fragments\FragmentContactanosCliente.java:478: error: cannot find symbol
FragmentContactanosClienteDirections.ActionNavContactanosToNavMensajeUsuario action = symbol: class ActionNavContactanosToNavMensajeUsuario
location: class FragmentContactanosClienteDirections
But when I comment the second piece of code (navigation_inicial), the problem disappears. The thing is that I need the second piece of code because I need to recall fragment and share with it bundles, with other information and show different things... How can achieve this?
I also share the design of graphs:
mobile_navigation
mobile_navigation.xml (design)
navigation_inicial