For some reason, when testing on my Motorola Xoom with Ice Cream Sandwich, the App Icon in the Action Bar is not clickable, even though I have implemented an event handler. This only occurs after changing the targetSdkVersion to 15. If it is 13 it is still clickable, even on ICS. Why is this happening and how can I make it clickable like a button? I searched the documentation and couldn't find anything.
Thank you.
UPDATE: Here is my code:
AndroidManifest.xml:
...
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@style/android:Theme.Holo.Light">
...
BaseActivity.java (my activities all inherit from this class:
...
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// app icon in action bar clicked; go home
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
...