Domanda

I created an app with minimum SDK 7 in order to get maximum compatibility with circulating devices. On Android phones (GB2.3), pressimng Menu button pops up a menu strip on the bottom of the screen, and that is correct.

However on HC3.2 tablets, where no menu hardware key is present, I expected a soft-menu key on the bottom of the screen, but it didn't appear, so I can't open my menu.

I don't know where to investigate and which portion of my code to share, so could you please show me where do I have to look for menu softbutton?

After reading that menus are deprecated in most recent Android versions, I don't know if ICS4 has a soft-menu button or not. I never tested my app on such a device. Can you give me advices?

Thanks

È stato utile?

Soluzione

The link you provide tells you how to correctly provide action bars in your app so that the presence or otherwise of a physical menu button is irrelevant, so that's a good start.

Now, you need to combine that with a little runtime detection of the SDK version (just check the Build.VERSION.SDK_INT constant for Android 1.5 or above), along with some appropriate reflection to enable the same APK to run on any Android version starting with your minSDK version.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top