Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

question from:https://stackoverflow.com/questions/22313830/android-how-to-remove-the-back-home-button-in-the-action-bar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Use getActionBar().setDisplayHomeAsUpEnabled(false) to remove the home button from the action bar.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...