This is my menu xml file
<menu 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"
tools:context="ng.edu.binghamuni.bhu.ui.activity.HomeActivity">
<group android:checkableBehavior="single">
<item
android:id="@+id/drawer_item_today"
android:icon="@drawable/ic_schedule_black_48dp"
android:orderInCategory="100"
android:title="@string/today"
app:showAsAction="never" />
<item
android:id="@+id/drawer_item_classes"
android:icon="@drawable/ic_chrome_reader_mode_black_48dp"
android:orderInCategory="100"
android:title="@string/action_classes"
app:showAsAction="never" />
</group>
<item
android:id="@+id/drawer_item_settings"
android:checkable="false"
android:icon="@drawable/ic_settings_black_48dp"
android:orderInCategory="200"
android:title="@string/action_settings"
app:showAsAction="never" />
<item
android:id="@+id/drawer_item_logout"
android:checkable="false"
android:icon="@drawable/ic_exit_to_app_black_48dp"
android:orderInCategory="500"
android:title="@string/logout"
app:showAsAction="never" />
I use the Settings item to navigate to another activity and the Logout Item for Logging out (Obviously) and that's why i dont want them checked but it turns out Settings gets check and when i navigate to the Settings activity and come down the back stack the settings Item is checked.
Thanks in advance for your help.
You need to add the 'checkableBehavior' to the second group of items.