I am having difficulties trying to remove the back/home button from the action bar.
getActionBar().setDisplayShowHomeEnabled(false); //disable back button getActionBar().setHomeButtonEnabled(false);
In a older android phone, the back button is removed with these two code lines. However with the nexus 4, the back button still appears but is just disabled. Also I am just adding a menu item on the right that behaves like the back/home button replacing the back/home button. What am I missing?
Touch “Settings” -> “Display” -> “Navigation bar” -> “Full screen gestures”. The navigation bar will be hidden and you will be shown “Gesture demos” to explain how to operate the “Go back”, “Go to Home screen” and “Open Recents” functions.
This example demonstrate about how to create a custom action bar in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
Please navigate to Android->Advanced Restrictions->Display Settings. Uncheck the 'Hide navigation bar' option. This will disable the on-screen buttons: back, home and recent apps.
Use getActionBar().setDisplayHomeAsUpEnabled(false)
to remove the home button from the action bar.
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