Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android honeycomb menu button target

I am trying to get my app to be backward compatible so i need to show the menu button since we used the menu button in our app on previous versions.

So I was reading and it says that if your target is 11 (3.0) than you don't get the menu button but it your target is 10 they you do.

But the issue is I am using fragments so my target has to be 11.

Any thoughts.

like image 597
user498584 Avatar asked Mar 11 '11 22:03

user498584


1 Answers

Ordinary options menus will appear regardless of Android version. If you have:

android:targetSdkVersion="11"

then the options menu will appear in the action bar on Android 3.0+ devices. All items in the options menu will be available when clicking the "overflow" button in the upper-right corner. Your options menu will appear normally on Android 1.x and 2.x devices, even if you have android:targetSdkVersion="11" in your <uses-sdk> manifest element.

If you overrode the MENU button to have other behavior, you will need to create some other trigger for that behavior for API Level 11 and higher. Overriding the MENU button was never a good idea to begin with, and as you can see, it is even less of a good idea now. I know of no way to get a MENU button on an Android 3.0 device if you have android:targetSdkVersion="11".

like image 183
CommonsWare Avatar answered Oct 21 '22 10:10

CommonsWare