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

后端 未结 9 1493
一向
一向 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:03

    None of the suggested solutions works for me.

    But this one does:

    // Hide the back button
    mActionBar.setHomeAsUpIndicator(null);
    

    It is a kind of a hack (last resort solution), though, so showing the action bar again means setting its icon back again.

提交回复
热议问题