-1

I noticed that if you are using the actionbar with a device that has a "menu" hardware button, the 3-dot dropdown menus does not shows off. So in my app i have this menu layout:

<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=".MainActivity">

<item
    android:id="@+id/action_settings"
    android:title="@string/action_settings"
    app:showAsAction="never"
    android:orderInCategory="100"
     />
<item
    android:id="@+id/action_credits"
    android:title="@string/action_credits"
    android:orderInCategory="100"
    app:showAsAction="never"
    />
<item android:title="@string/action_project"
        android:id="@+id/action_project"
    android:orderInCategory="100"
    app:showAsAction="never"
    />
</menu>

If i try my app in a device without the hardware menu button, then the 3-dots appear in the action bar, otherwise the 3-dots dropdown menu is not displayed. Why? How can I force the display of the menu to leaving aside whether the device is or is not in possession of the key hardware ?

madmad
  • 9
  • 7

2 Answers2

0

Try like this

<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=".MainActivity">

 <item
  android:id="@+id/action_settings"
  android:title="@string/action_settings"
  android:orderInCategory="100"
  android:icon="@drawable/menu_icon"
  app:showAsAction="always">
  <menu>
    <item
    android:id="@+id/action_settings1"
    android:title="@string/action_settings1"
    app:showAsAction="never"
    android:orderInCategory="100"
     />
  <item
    android:id="@+id/action_credits"
    android:title="@string/action_credits"
    android:orderInCategory="100"
    app:showAsAction="never"
    />
  <item android:title="@string/action_project"
        android:id="@+id/action_project"
    android:orderInCategory="100"
    app:showAsAction="never"
    />
  </menu>
</item>
</menu>
Chandrakanth
  • 3,711
  • 2
  • 18
  • 31
0

Overflow menu (3 dot) not shown by design on devices with hardware menu button.

This is correct behaviour. Yom must not force it to show or mimic in any way.

Android phones with traditional navigation hardware keys don't display the virtual navigation bar at the bottom of the screen. Instead, the action overflow is available from the menu hardware key.

dasar
  • 5,321
  • 4
  • 24
  • 36