I have this problem with the Android ActionBarCompat project: On emulators with Android 4.0 the click on the app icon doesn't cause any onOptionsItemSelected
event, whereas it works on all other OS versions.
Any input is greatly appreciated!
I have this problem with the Android ActionBarCompat project: On emulators with Android 4.0 the click on the app icon doesn't cause any onOptionsItemSelected
event, whereas it works on all other OS versions.
Any input is greatly appreciated!
I had this problem as well. This code did the trick for me:
Some extra info:
minSdkVersion="7" targetSdkVersion="18"
. This is theLAUNCHER
activity of my project, so it has no parent activity. UsingsetDisplayHomeAsUpEnabled(true)
in other activities worked just fine.Are you seeing any touch feedback from the app icon? (Does it glow when you press it?)
Since many activities do not use the action bar home button, in apps that target API 14+ running on Android 4.0 it is disabled by default. (This is so that users don't try pressing it, see it glow, and wonder why nothing happened.) Apps that want to use this should call
ActionBar#setHomeButtonEnabled(true)
.We should probably revise the ActionBarCompat sample to surface this more clearly. One simple way to get you up and running would be to modify ActionBarHelperICS.java and add the following:
In an app where you want more control over turning this on and off you would want to make further changes.