3

I walked into (imho) strange behaviour regarding the Menu of Android.

The Problem:

When you place your finger on the menu item (in form of a water-drop) (which is parent of the submenu/group) and swipe it down, select an option and release your finger, everything works out fine.

BUT afterwards you're not able to press the drop menu item a second time.

What I have:

This is how it looks inside the App:

enter image description here

1 . Menu registered like this:

 public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        ...
}

2 . The Style for the Menu is something like this: (The group does not seem to be direct responsible)

<menu xmlns:android="http://schemas.android.com/apk/res/android">
...
<item ... >
    <menu>
        <group android:checkableBehavior="single">
            <item
                android:id="@+id/menu_fuelTypeDiesel" />
            <item
                android:id="@+id/menu_fuelTypeE5" />
            <item
                android:id="@+id/menu_fuelTypeE10" />
        </group>
    </menu>
</item>
...
</menu>

3 . An onOptionsItemSelected-Listener with a Switch-Case-Statement containing something like the following:

 case R.id.menu_fuelTypeDiesel:
                someMethod(item);
                break;

Where someMethod calls item.setChecked(true); and some unimportant stuff.

What's interesting aswell: When you select another menu Item, which has not been shown on the ActionBar, you can press the Drop afterwards again.

I guess this is a kind of bug within Android?

Community
  • 1
  • 1
Max
  • 1,011
  • 1
  • 13
  • 20
  • Does this happen with non-group menu items also? – ozbek Aug 04 '14 at 02:27
  • This also occurs by not using a group. – Max Aug 04 '14 at 09:47
  • 1
    possible duplicate of [How to handle drag-to-select of sub-menu items on Kitkat?](http://stackoverflow.com/questions/23413116/how-to-handle-drag-to-select-of-sub-menu-items-on-kitkat) – adneal Aug 05 '14 at 00:40

1 Answers1

1

It seems to be a bug in KitKat.

There is an issue on Google Code here: https://code.google.com/p/android/issues/detail?id=69205

Max
  • 1,011
  • 1
  • 13
  • 20