We welcome you and thank you for reading this question.
I am trying to develop an Android application that will use the ActionBar compatibility library. I followed (as far as I can see) all the recommendations when using the compatibility library. My manifest looks like this (only relevant code):
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.AppCompat.Light" > </application> </manifest>
As you can see, I am targeting sdk 8+. I used Theme.AppCompat theme as recommended.
My menu file is as follows:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cds="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_map" android:icon="@drawable/ic_action_map" android:title="@string/action_map" cds:showAsAction="ifRoom"/> <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" cds:showAsAction="ifRoom"/> <item android:id="@+id/action_mail" android:icon="@drawable/ic_action_mail" android:title="@string/action_mail" cds:showAsAction="ifRoom"/> </menu>
I use my own namespace for the showAsAction attribute.
My activity extends the ActionBarActivity class.
The problem is this: on sdk 10 (android 2.3.3), both on the device and on the emulator, the overflow menus (three dots to the right of the action bar) are not displayed. Only the first 2 menu items are displayed on the action bar. If I press the Menu button on the device, the third item will appear in the lower left corner of the screen (not in the upper right corner, as on devices with later versions of Android). The same code works well on android sdk 17 on the emulator (the overflow menu is displayed with the corresponding actions).
I searched the Internet for a solution, but could not find it with this particular problem. I would have avoided this problem if I hadnβt installed applications on an Android 2.3.3 device that have the same action bar and that show an overflow menu icon and work properly, like on any last Android device. One example of this application is the todoist application ( https://en.todoist.com/android ) or the processing application ( https://play.google.com/store/apps/details?id=com.handcent.nextsms&hl= en ) that both behave well on this device.
Is there anything I can't see, or is there an alternative solution for the recommended way to use compatibility with the program?
Thank you for your time.