SetDisplayHomeAsUpEnabled action bar does not work on ICS

In activity I have:

ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); 

and for this activity in AndroidManifest

 android:parentActivityName=".MainActivity" 

and this provides the up button, which works correctly on Bean jelly (4.3), but on ICS (4.0.3) on both the physical device and the emulator nothing happens when this button is pressed.

+4
source share
1 answer

Unfortunately, the android: parentActivityName attribute is only supported after API level 16 (JellyBean). As an alternative, support-library: v7 is used in combination with NavUtils .

There is a lot of training material on this topic (including compatibility issues). please check - http://developer.android.com/training/implementing-navigation/ancestral.html

+8
source

All Articles