Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using appcompat support library, Overflow not working on API 7?

I am using v7 appcompat support library. The action items work showing in the actionBar just fine on either newer or older devices.

However, I don't get Overflow on API 7. For example:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:appcompat="http://schemas.android.com/apk/res-auto" >

    <item
        android:id="@+id/menuAction"
        android:icon="@android:drawable/ic_menu_directions"
        android:title="@string/barButtonTitle"
        appcompat:showAsAction="always|withText"/>
    <item
        android:id="@+id/menuAction1"
        android:title="@android:string/untitled"
        appcompat:showAsAction="never"/>

</menu>

appcompat:showAsAction="always|withText" works, it shows as an Action Item in ActionBar. However, appcompat:showAsAction="never" doesn't show in the Overflown as it does in newer platform. It is hidden on the bottom, and revealed when you pressed on the older menu button.

Is that the intended behavior from appcompat support library? or am I missing anything to get the Overflow working on the older platform?

like image 435
Sean Avatar asked Nov 02 '22 13:11

Sean


1 Answers

Is that the intended behavior from appcompat support library?

Yes, it is


The overflow button (3 dots) is only shown if the devices don't have a hardware menu button.

Every gingerbread-device must have a menu-button, so the overflow button won´t show on API level 7

For more information about this topic, the following blog-post might be interesting: http://android-developers.blogspot.de/2012/01/say-goodbye-to-menu-button.html

like image 77
larsgrefer Avatar answered Jan 04 '23 13:01

larsgrefer