In an activity I have:
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
and for that activity in the AndroidManifest
android:parentActivityName=".MainActivity"
and this provides the up button that works correctly on Jelly Bean (4.3), but on ICS (4.0.3) both on a physical device and on the emulator, nothing happens when this button is clicked.
Unfortunately, android:parentActivityName attribute supported only after API level 16 (JellyBean) One alternative is using support-library:v7 combined with NavUtils.
There is a great training material about this topic (include compatibility issue). please check - http://developer.android.com/training/implementing-navigation/ancestral.html
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