According to Google\'s document, getActionBar().setDisplayHomeAsUpEnabled(true)
is needed to show the up button. I created a bare-bone activity using the wizard in
I described all possible combinations below and their outcomes:
android:parentActivityName=".MyActivity
and this getActionBar().setDisplayHomeAsUpEnabled(true);
- back button appears and it works; android:parentActivityName=".MyActivity
- back button appears and it works, the same as above;getActionBar().setDisplayHomeAsUpEnabled(true);
, - back button appears but clicking on it doesn't go anywhere;getActionBar().setDisplayHomeAsUpEnabled(false);
, even though you have this android:parentActivityName=".MyActivity
in the manifest, the back button doesn't show up.That's how this works my friend.
When you specify a parentActivityName
in your AndroidManifest
, Acitivty
will check for that and automatically enable the "up" affordance if it's present.