I have to hide menu item dynamically. Below I have written menu.xml file code
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single" android:id="@+id/menu1">
<item
android:id="@+id/Admin"
android:title="Admin" />
</group>
<group android:checkableBehavior="single" android:id="@+id/menu2">
<item
android:id="@+id/Worker"
android:title="Worker" />
</group>
</menu>
I have to hide Admin menu while logging with Worker.