0

Menu Layout

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

<!-- Search Widget -->
<item
    android:id="@+id/action_search"
    android:icon="@drawable/action_ic_search"
    android:title="@string/action_settings"
    android:orderInCategory="1"
    myapp:showAsAction="always"/>

<!-- Location Found -->

<item
    android:id="@+id/action_location_found"
    android:icon="@drawable/action_ic_location_found"
    android:title="@string/action_settings"
    android:orderInCategory="2"
    myapp:showAsAction="always"/>

<item
    android:id="@+id/action_location"
    android:icon="@drawable/action_ic_place"
    android:title="@string/action_settings"
    android:orderInCategory="3"
    myapp:showAsAction="always"/>

I create Actionbar in Android API 10 and I use android support v7 appcompat. I see in some tutorial that when we set android:showAsAction="never" we will get the overflow menu. However when I run my app only 2 item appear and the overflow menu not appear. What should I do to show the overflow menu.

Thanks for your help.

Cem Özer
  • 1,263
  • 11
  • 19
Linh
  • 433
  • 6
  • 11
  • You should check this post, it may help http://stackoverflow.com/questions/18510337/actionbar-not-shown-with-appcompat – Cem Özer Jul 10 '14 at 10:47
  • Thank you but it doesn't work for me – Linh Jul 10 '14 at 10:59
  • Did you try changing 'showAsAction's from always to ifRoom? I have not that much experience with appcompat, just guessing. Setting always forces app to show item and it can be overlap with other items as a result. – Cem Özer Jul 10 '14 at 11:06
  • Yes. I did that way but it didn't work. – Linh Jul 11 '14 at 01:03

1 Answers1

2

What Device are you using? devices with a Menu Button e.g. Samsung Galaxy S4 hide the overflow Button in the Actionbar, and it is available through the Hardware Menu Button

Marvin
  • 226
  • 1
  • 9
  • I'm using the Samsung Galaxy S2. Could you recommend me some another device which show the Overflow menu – Linh Jul 10 '14 at 10:39
  • 1
    If you have a question to OP, you should comment. Also this is not an actual answer, it's just an assumption. – Cem Özer Jul 10 '14 at 10:40
  • @PhanVănLinh You can use avd to check if issue comes from device. – Cem Özer Jul 10 '14 at 10:42
  • I used to check with Nexus S, Nexus One, Samsung Galaxy S2 and it didn't show the overflow menu. I think my problem doesn't come from the avd – Linh Jul 10 '14 at 10:53