Difference between actionBar back button and android back button

Csabi Vidó picture Csabi Vidó · Dec 3, 2014 · Viewed 7.2k times · Source

What is the difference between actionBar back button and android back button? Because it's seems that the ActionBar back button which is called with:

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

it works way better...

example: when I press the ActionBar back button the animations are there, but if I press the default back button they aren't.

I can change theme from a preference activity: If I go back with the ActionBar back button the colors instantly changed, but with the default I have to restart the app....

how can I make my default back button to behave like the ActionBar one?

Answer

Julian Suarez picture Julian Suarez · Dec 3, 2014

The ActionBar "back" button is actually an "Up" button and it should take you to higher level on your app's navigation hierarchy. The back button takes you to the last place you were looking at.

Another great tip to better undertand this is that the "Up" button should always take you to a place on your app, while the back button might take you to another app.

You might want to read this article to better understand the difference: http://developer.android.com/design/patterns/navigation.html