What is the difference between setDisplayHomeAsUpEnabled and setHomeButtonEnabled?
For what you want to do, actionBar.setDisplayHomeAsUpEnabled(true)
is enough.
For the difference :actionBar.setHomeButtonEnabled(true)
will just make the icon clickable, with the color at the background of the icon as a feedback of the click. actionBar.setDisplayHomeAsUpEnabled(true)
will make the icon clickable and add the <
at the left of the icon.
As Android says:
- setDisplayShowHomeEnabled(boolean showHome)
// Set whether to include the application home affordance in the action bar.
// (and put a back mark at icon in ActionBar for "up" navigation)
-setHomeButtonEnabled(boolean enabled)
// Enable or disable the "home" button in the corner of the action bar.
// (clickable or not)
It should be quite clear i think