Add items to menu group programatically in navigation view
<p>I am trying to add menu items to menu group pragmatically but I found no way to do that. I am using Navigation View and added below mentioned menu:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;item
        android:id="@+id/nav_lang_currency"
        android:title="" /&gt;

    &lt;item
        android:id="@+id/nav_home"
        android:title="" /&gt;

    &lt;group android:id="@+id/nav_refer" /&gt;

    &lt;item
        android:id="@+id/nav_setting"
        android:title="" /&gt;

    &lt;item
        android:id="@+id/nav_about_us"
        android:title="" /&gt;

    &lt;item
        android:id="@+id/nav_logout"
        android:title="" /&gt;

&lt;/menu&gt;
</code></pre>

<p>Everything looks good as mentioned.</p>

<p>I just want to add multiple menu items in <code>nav_refer</code> group at run-time as per business requirement but I found no way to do that.</p>

<p>I searched solution on SO but found no way to do that.</p>

<p>Kindly suggest me how to add multiple menu items in group at run-time.</p>