How to get a default string value from resources in SafeArgs? : <p>I'm just learning a Android NavigationUI, and try set a toolbar title using string default value from Safe Args. But have some problem about it.</p>

<p>'String resources' file:</p>

<pre><code>    &lt;string name="title_add_item"&gt;Add new items&lt;/string&gt;
</code></pre>

<p>Navigation graph file. Set label as <code>Title: {title}</code> argument.</p>

<pre><code>&lt;navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/mainFragment"&gt;

&lt;fragment
    android:id="@+id/addNewItemFragment"
    android:name="com.myapplication.AddNewItemFragment"
    android:label="Title: {title}"
    tools:layout="@layout/fragment_add_new_item" &gt;
    &lt;argument
        android:name="title"
        app:argType="string"
        android:defaultValue="@string/title_add_item" /&gt;
&lt;/fragment&gt;
&lt;fragment
    android:id="@+id/mainFragment"
    android:name="com.myapplication.MainFragment"
    android:label="fragment_main"
    tools:layout="@layout/fragment_main" &gt;
    &lt;action
        android:id="@+id/action_to_add_items_fragment"
        app:destination="@id/addNewItemFragment" /&gt;
&lt;/fragment&gt;
</code></pre>

<p></p>

<p>If <code>{app:argType="string"}</code> I got an error :</p>

<pre><code> Caused by: org.xmlpull.v1.XmlPullParserException: unsupported value 'Add new items' for string. You must use a "reference" type to reference other resources.
</code></pre>

<p>If  <code>{app:argType="reference"}</code> app works, but i have a number in title (i think it's a resource id):</p>

<p><a href="https://i.stack.imgur.com/iWOIS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iWOIS.png" alt="enter image description here"></a></p>

<p>Of course I can assign the value of the toolbar title in the code by getting it from the arguments. But is it possible to change this code so that the title filled in correctly?</p>
