i'm using nav controller 1.0.0alpha05 and it is working great, but i'm struggling with this dreaded error when i execute a navigation action after an activity result.
I have a single activity/multiple fragments structure, in particular a fragment with a list of items and another one with the form for adding a new one.
When i add another one without any picture it is working and returning to the previous one with the list of items, but when i take some photos i get the exception during the navigation.
Caused by: java.lang.IllegalArgumentException: navigation destination XX is unknown to this NavController
Navigation graph of the form fragment containing the action:
<fragment
android:id="@+id/idFormFragment"
android:name="FormFragment"
android:label="FormFragment"
tools:layout="@layout/form_fragment">
<argument
android:name="idClient"
android:defaultValue="-1"
app:argType="integer" />
<argument
android:name="idServer"
app:argType="string" />
<action
android:id="@+id/actionFormToList"
app:destination="@id/idListFragment" />
</fragment>
Code of the action call with safe args
FormFragmentDirections.ActionFormToList action = new FormFragmentDirections.ActionFormToList(sample.getIdJob());
Navigation.findNavController(getView()).navigate(action);
Thanks for your time