问题
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?
回答1:
Turns out the good old @null
works
<argument
android:name="profile_id"
android:defaultValue="@null"
app:argType="string"
app:nullable="true" />
来源:https://stackoverflow.com/questions/53661394/how-to-set-null-as-the-default-value-for-a-nullable-argument-using-safeargs