1

Good day !
I've got a problem with Navigation Drawer, only when I split items into two groups.

Here is what is going on :

  • When I split them into two groups ( Settings, Profile etc. ) and another one for Sign Out ( just because this one has nothing to do with others ), I can barely click the Sign Out button due to the line drawn above by grouping items.

  • When I have only one group with all items ( Settings, Profile etc , Sign out ), I can click and call action for each without trouble ).

Does anyone knows why this happens ?

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group
        android:id="@+id/menu_top"
        android:checkableBehavior="single">

        <item
            android:id="@+id/button1"
            android:title="Button 1"
            android:icon="@drawable/ic_android_bell_24px"/>

        <item
            android:id="@+id/button2"
            android:title="Button 2"
            android:icon="@drawable/ic_android_history_24px"/>

        <item
            android:id="@+id/button3"
            android:title="Button 3"
            android:icon="@drawable/ic_android_dollar_24px"/>

        <item
            android:id="@+id/button4"
            android:title="Button 4"
            android:icon="@drawable/ic_android_settings_24px"/>

    </group>

    <group
        android:id="@+id/menu_bottom"
        android:checkableBehavior="single">

        <item
            android:id="@+id/signOut"
            android:title="Sign Out"
            android:icon="@drawable/ic_android_signout_24px"/>

    </group>

</menu> 

For sure. Here are the cases :

Grouped menu items

Same group menu items

  • Can you add screenshot of the problem – Psypher Jun 06 '18 at 15:03
  • First case when all menu items are grouped individually : ( header -> picture + username ) ; options ; sign out -> for it to work, the tap/click on "Sign Out" menu item is somehow above it, just under the line. Second is when it works fine, but I would like to have them separated. – swift_dev25 Jun 07 '18 at 08:29
  • Can you remove `android:checkableBehavior="single"` in the signout and try. You wouldnt need it anyway. Also can you post the code for `onOptionsItemSelected` – Psypher Jun 07 '18 at 16:08

0 Answers0