Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set `null` as the default value for a nullable argument using SafeArgs?

How should I pass in null as default value for a String argument such as this:

<argument
    android:name="profile_id"
    android:defaultValue="???"
    app:argType="string"
    app:nullable="true" />

If the argument is nullable there should be a way to pass in null right?

like image 261
Kayvan N Avatar asked Dec 06 '18 23:12

Kayvan N


1 Answers

Turns out the good old @null works

<argument
    android:name="profile_id"
    android:defaultValue="@null"
    app:argType="string"
    app:nullable="true" />
like image 181
Kayvan N Avatar answered Nov 11 '22 12:11

Kayvan N