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:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/nav_lang_currency"
android:title="" />
<item
android:id="@+id/nav_home"
android:title="" />
<group android:id="@+id/nav_refer" />
<item
android:id="@+id/nav_setting"
android:title="" />
<item
android:id="@+id/nav_about_us"
android:title="" />
<item
android:id="@+id/nav_logout"
android:title="" />
</menu>
Everything looks good as mentioned.
I just want to add multiple menu items in nav_refer
group at run-time as per business requirement but I found no way to do that.
I searched solution on SO but found no way to do that.
Kindly suggest me how to add multiple menu items in group at run-time.