In the % activity_main_drawer.xml
I define the elements of Navigation Drawer
and separate them into 3 blocks as shown
in the image shown at the end of the post.
When selecting a elemento
of the first block (Start, Notices, Installations, Favorites), the color background of this one turns gray (Correct), but
if you select some elemento
of the second (Location, Activities, Schedule) or of the third block (Language), do not change the background color of the element.
activity_main_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_hasiera"
android:title="@string/nav_hasiera" />
<item
android:id="@+id/nav_oharrak"
android:title="@string/nav_oharrak" />
<item
android:id="@+id/nav_instalazioak"
android:title="@string/nav_instalazioak" />
<item
android:id="@+id/nav_gustokoak"
android:title="@string/nav_gustokoak" />
</group>
<item android:title="@string/filtrar_por">
<menu>
<item
android:id="@+id/nav_lokalizazioa"
android:title="@string/nav_lokalizazio" />
<item
android:id="@+id/nav_ekintzak"
android:title="@string/nav_ekintzak" />
<item
android:id="@+id/nav_ordutegia"
android:title="@string/nav_ordutegia" />
</menu>
</item>
<item android:title="@string/opciones">
<menu>
<item
android:id="@+id/nav_hizkuntza"
android:title="@string/nav_hizkuntza" />
</menu>
</item>
</menu>
Capture after clicking on item
Instalaciones