I would like to convert/adapt my application to Android 4.0. To do so I plan to use the ActionBar on devices that support it. All Android version >= 3.0 do so. Furthermore devi
If your application includes functionality that would respond to a menu button, the menu button will be added to the black bottom bar.
If you are having trouble seeing this in the emulator, you can do a bit of a workaround by setting it to a tablet resolution (I use 1280x800) and observing your menu button behavior there, as it should be the same as on the phone version.
When you create new emulator there is grid Hardware, and there you can add options Hardware home and back buttons and Hardware keyboard. So, create new emulator and look at your "Galaxy Nexus" :)
Unfortunately you can't change this properties for existing emulator.
It seems the issue was fixed with the latest update of the SDK (R16). Just update your SDK and ADT to R16 and create a new emulator using the updated Android 4.0 system image.
The soft keys showed up for me when I set hw.mainKeys
to no
:
$HOME/.android/avd/YOURS.avd/config.ini
hw.mainKeys=no
(This was covered in a deleted answer; don't know why it was deleted.)
After upgrading to R16 I could only get the on-screen buttons to appear if I created an emulator using the WXGA720 resolution.
Here is my complete config.ini file:
hw.sdCard=yes
hw.mainKeys=no
hw.lcd.density=320
disk.cachePartition.size=256MB
hw.cpu.arch=arm
skin.name=WXGA720
sdcard.size=512M
abi.type=armeabi-v7a
image.sysdir.2=system-images\android-16\armeabi-v7a\
image.sysdir.1=add-ons\addon-google_apis-google-16\images\armeabi-v7a\
hw.gps=yes
skin.path=platforms\android-16\skins\WXGA720
hw.keyboard.lid=no
hw.cpu.model=cortex-a8
vm.heapSize=48
hw.ramSize=1024
Hopefully this helps someone.