• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Menu button / Actionbar

zonk

Newbie
I wrote an app the other day but was only testing on an old 2.1 phone which had a hardware Menu button. Today I put it on a 4.1 device without a hardware Menu button.

After looking about I found out about the Actionbar. I eventually followed the official Android tutorial on using the compat libraries (can't post a link yet!)(also decided not to use ActionbarSherlock), sooo, now my 2.1 device has a new title thing and a new menu, however on the 4.1 device nothing. I've followed various tutorials now and still i'm not seeing anything on the Actionbar.

Basically these modifications are the wrong way around, it was fine on 2.1 as it was, I really just needed to get some kind of menu button on the Actionbar on the 4.1 but still be compatible with 2.1, any solutions please?


EDIT:
Just watching some youtube vids on the subject, and i'm realising that the Actionbar is another bar in addition to the big one across the bottom (on my device), what i'm actually after is to add a menu to the big system bar when my app is active, not have another bar taking up screen space...
 
Maybe not how i'm going to proceed but found my answer here:
Say Goodbye to the Menu Button | Android Developers Blog

If your app runs on a device without a dedicated Menu button, the system decides whether to add the action overflow to the navigation bar based on which API levels you declare to support in the <uses-sdk> manifest element. The logic boils down to:

  • If you set either minSdkVersion or targetSdkVersion to 11 or higher, the system will not add the legacy overflow button.
  • Otherwise, the system will add the legacy overflow button when running on Android 3.0 or higher.
  • The only exception is that if you set minSdkVersion to 10 or lower, set targetSdkVersion to 11, 12, or 13, and you do not use ActionBar, the system will add the legacy overflow button when running your app on a handset with Android 4.0 or higher.

So, changed target to 13 instead of 19...

However this isn't in accordance with Android developer guidelines.
 
Back
Top Bottom