Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.support.v7 Toolbar & DrawerLayout- how to hide Hamburger icon

I am implementing Toolbar along and Navigation drawer.I am customized my tool bar with my own views.I have my own menu(Hamburger) icon in my toolbar to open navigation drawer and I am showing badge count on my menu icon(Hamburger).So i would like to hide default Hamburger icon.

I have tried like this:

getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(false);

Please help me.Thanks in advance.

like image 870
hcp Avatar asked Feb 19 '15 10:02

hcp


People also ask

How do you get to the toolbar menu on Android?

Make a menu xml This is going to be in res/menu/main_menu . Right click the res folder and choose New > Android Resource File. Type main_menu for the File name. Choose Menu for the Resource type.

Where is the toolbar in Android?

In Android applications, Toolbar is a kind of ViewGroup that can be placed in the XML layouts of an activity. It was introduced by the Google Android team during the release of Android Lollipop(API 21). The Toolbar is basically the advanced successor of the ActionBar.


1 Answers

call .setDrawerIndicatorEnabled(false); on your ActionBarDrawerToggle

like image 85
codemolly Avatar answered Nov 14 '22 04:11

codemolly