android: how to remove the back/home button in the action bar

后端 未结 9 1566
一向
一向 2020-12-29 02:20

I am having difficulties trying to remove the back/home button from the action bar.

 getActionBar().setDisplayShowHomeEnabled(false);   //disable back button         


        
9条回答
  •  爱一瞬间的悲伤
    2020-12-29 03:09

    In case where you have used toolbar as Action bar:-

    Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar);

    Use the below code to hide navigation button:-

    toolbar.setNavigationIcon(null);

提交回复
热议问题