We have a file manager-like application where we use the action bar home button as a "go up in the folder structure" action. If the user is at the top of the folder structure, the button should be disabled.
We set the home button as up when the user is within a sub folder. Shen we reach the top folder, we disable showing as up.
// Update home
actionBar.setDisplayHomeAsUpEnabled(hasParent);
the problem is that the button is still "enabled" in that the user can press it can see visual feedback that is was pressed. we want the action bar home button to be completely disabled in this case, when there is no parent folder.
I tried calling setDisplayShowHomeEnabled()
, but does not disable the button but in stead this removes the home button completely.
Any ideas?
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.
Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
Did you try setHomeButtonEnabled()
? That is new to API Level 14, so you would have to skip it for Honeycomb tablets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With