android - Weird NavigationView Checkable behavior -
this 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 settings item navigate activity , logout item logging out (obviously) , that's why dont want them checked turns out settings gets check , when navigate settings activity , come down stack settings item checked.
thanks in advance help.
<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" /> <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" /> </group>
you need add 'checkablebehavior' second group of items.
Comments
Post a Comment