Calvin Kung Calvin Kung - 6 months ago 27
Android Question

Overflow button on ActionBar not shown on Android Studio sample application

It seems similar question has been asked here before, but I can't the answer yet.

I am using the latest Android Studio, and create a new project, using the template "Navigation Drawer Activity".

The menu xml is like this:

<menu xmlns:android=""
xmlns:tools="" tools:context=".MainActivity">
<item android:id="@+id/action_example" android:title="@string/action_example"
app:showAsAction="withText|ifRoom" />
<item android:id="@+id/action_settings" android:title="@string/action_settings"
app:showAsAction="never" />
<item android:id="@+id/action_test3" android:title="test3"
app:showAsAction="never" /></menu>

The Overflow button is not showing on the right upper corner. If I pressed android phone menu button, I can see the pop up on the lower part of the screen. How can I show the overflow button as seen on many other applications ?

The screen capture here:


Try below code :

Put this inside your activity class if you want to Force to the Application to show the Action Overflow:

try {
    ViewConfiguration config = ViewConfiguration.get(this);
    Field menuKeyField = ViewConfiguration.class
    if (menuKeyField != null) {
        menuKeyField.setBoolean(config, false);
} catch (Exception ex) {
    // Ignore

For more information visit my another answer: Overflow menu not working