I'm using android navigation components with safe args. I set that the argument is null-able and default value as null too.
The problem is when I want to pass any value an error is shown:
required: no arguments
found: Character
reason: actual and formal argument lists differ in length
My fragment XML code:
<fragment
android:id="@+id/bookListFragment"
android:name="com.example.bookstory.UI.Fragments.BookListFragment"
android:label="fragment_book_list"
tools:layout="@layout/fragment_book_list">
<argument
android:name="character"
app:argType="com.example.bookstory.DAO.Character"
app:nullable="true"
android:defaultValue="@null" />
</fragment>
My action:
<action
android:id="@+id/action_bookDescriptionFragment_to_bookListFragment"
app:destination="@id/bookListFragment"
app:popUpTo="@id/bookListFragment"
app:popUpToInclusive="true" />
I can't understand what is the problem - when I delete the default value it is OK.