Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBar setDisplayHomeAsUpEnabled(true) vs setDisplayShowHomeEnabled(true). What's the difference?

Tags:

The title is pretty much self explanatory. What are the exact differences? I'll post sample code below.

actionbar = getSupportActionBar();
actionbar.setDisplayHomeAsUpEnabled(true);
actionbar.setDisplayShowHomeEnabled(true);
like image 537
user3144836 Avatar asked May 20 '14 18:05

user3144836


People also ask

What is setDisplayShowHomeEnabled?

setDisplayShowHomeEnabled() specifies whether or not the Home button is shown. ActionBar. setDisplayHomeAsUpEnabled() specifies whether or not the Home button has the arrow used for Up Navigation next to it.

How do I use Getupportactionbar?

To use the ActionBar utility methods, call the activity's getSupportActionBar() method. This method returns a reference to an appcompat ActionBar object. Once you have that reference, you can call any of the ActionBar methods to adjust the app bar. For example, to hide the app bar, call ActionBar.


1 Answers

The documentation is pretty much self explanatory.

ActionBar.setDisplayShowHomeEnabled() specifies whether or not the Home button is shown.

ActionBar.setDisplayHomeAsUpEnabled() specifies whether or not the Home button has the arrow used for Up Navigation next to it.

like image 115
matiash Avatar answered Sep 19 '22 09:09

matiash