3

Is there any behavior changes in connection with overflow menus in API level 24? It seems menus now draw submenus near the main menu (if there is enough space). Am I wrong? And some menus (with submenus) invoke crashes on my emulators. Here is an example of my menu's xml:

<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="com. ... .MainActivity">
    <item
        android:id="@+id/sub_menu1"
        android:orderInCategory="100"
        android:title="Submenu"
        app:showAsAction="never">
        <menu>
            <item
                android:id="@+id/action_settings11"
                android:orderInCategory="110"
                android:title="Item11"
                app:showAsAction="never" />
            <item
                android:id="@+id/action_settings12"
                android:orderInCategory="120"
                android:title="Item12"
                app:showAsAction="never" />
        </menu>
    </item>
    <item
        android:id="@+id/Item2"
        android:orderInCategory="200"
        android:title="Item2"
        app:showAsAction="never"/>
</menu>

Update1: Here's the link to the Issue Tracker and an interesting comment that describes how to prevent crashes on emulators:

#8 ... It seems like enabling under "developer settings" the option of "show layout bounds" prevents the crash.

Update2: It seems now works fine on API level 25.

user35603
  • 765
  • 2
  • 8
  • 24

0 Answers0