How do you remove the back button from a v7 toolbar on Android?

15,644

If you are using v7 Toolbar you can remove this button with this code :

if (getSupportActionBar() != null) {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
}

you can read android here and here for more information. also this question may help

Share:
15,644
Admin
Author by

Admin

Updated on June 25, 2022

Comments

  • Admin
    Admin almost 2 years

    How do you remove the back button from a v7 toolbar on Android?

    I highlighted the button that I'm trying to remove in the image below:

    enter image description here