I have a Google Nexus 7 tablet, which runs Android 4.1.1, and I can't seem to get my app to display the little "three tiny squares in a vertical line" symbol on the lower right indicating that there's an options menu available. My build, targeted at 2.3.3, will display an options menu on other devices (a 2.3.3 phone and a 4.0.3 phone), but not on the Nexus 7. To illustrate the problem, I used Eclipse to build both a bare-bones "Hello World", which comes with a single option menu item, 'Settings', and also built the BluetoothChat example from the Android-10 SDKs. The barebones one doesn't have the menu symbol, while the BluetoothChat does. Looking at the code for each, I can't see a difference in how the menus are handled as far as construction and inflation, so I'm hoping somebody has some ideas. Good menu icon: http://i.imgur.com/31Wop.jpg No menu icon: http://i.imgur.com/9Vj3e.jpg
Found the problem. In the manifest I had
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
Changing that to
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" />
fixed the problem and now the menu button on the ActionBar appears. The BluetoothChat sample worked because its manifest omitted the targetSdkVerion:
<uses-sdk minSdkVersion="6" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With