1
votes

My application uses ActionBarActivity and DrawerLayout and etc. i want to change the ActionBarDrawerToggle icon to be custom drawable.

in my code i use android.support.v7.widget.Toolbar as SupportActionBar

this is my code:

 toolbar.setNavigationIcon(R.drawable.lifeline_shield);
 setSupportActionBar(toolbar);
 ActionBar actionbar = getSupportActionBar();
 actionbar.setDisplayHomeAsUpEnabled(true);
 actionbar.setDisplayShowTitleEnabled(false);

mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.somestring1, R.string.somestring2) ....

but still i see the Hamburger icon, so i have my own icon for opening the drawer. How can I solve this? without using deprecated api

1
to do this .. you have to use custom action bar .. by using inflatingSukhwant Singh Grewal

1 Answers

7
votes

Possible workaround:

mDrawerToggle.setDrawerIndicatorEnabled(false);
mDrawerToggle.setHomeAsUpIndicator(yourdrawableres);