Development issue/problem:

I am having problems with the v7 toolbar. What was once a simple task for the ActionBar now seems too complicated. No matter what style I choose, I cannot change the navigation icon (which opens the box) or the overflow menu icon (which opens the menu).

So I have a toolbar

I’m coding it to look like this.

//I do
mToolbar = (Toolbar) findViewById( in code ;

private void initToolbar() {

Now I need to change the images on these two icons.

How do I use the Compat v7 toolbar? I think I need to change the arrow that is visible when the box is open (Android 5.0).

How can I solve this problem?

Solution 1:

To change the navigation icon, you can use

Toolbar = (Toolbar) findViewById( ;
setSupportActionBar(Toolbar) ;
toolbar.setNavigationIcon(R.drawable.my_icon) ;

You can use this method to change the overflow icon:

toolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_menu) ;

If you want to change the color of the icons, you can use

with the theme of the hardware component (for example, with the MaterialToolbar) :

With the theme AppCompatible :

You can also replace the overflow icon in the application theme with the ActionOverflowButtonStyle attribute :

With the theme of hardware components:

With the theme AppCompatible :

Solution 2:

mToolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.ic_menu))

Solution 3:

For a good menu, it is possible:

public static setTintDrawable(drawable, @ColorInt int color) {
drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);
drawable wrapDrawable = DrawableCompat.wrap(drawable).mutate();
DrawableCompat.setTint(wrapDrawable, color);
return wrapDrawable;

And in your activities.

@General Boolean menu
onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(, menu);
Drawable send = menu.findItem(;
Drawable msg = menu.findItem(;
DrawableUtils.setTintDrawable(send.getIcon(), Color.WHITE);
DrawableUtils.setTintDrawable(msg.getIcon(), Color.WHITE);
return true;

Here’s the result:

How to change Toolbar Navigation and Overflow Menu icons (appcompat v7)? –

Solution 4:

There is a simple, easy and better approach if we only need to change the color of the hamburger/back icon.

This is better because it only changes the color of the desired icon, while colorControlNormal and android:textColorSecondary can affect the other child views of the toolbar.

Solution no. 5:

If you want to change the symbols to Vector, create a new one.
, then in :

Toolbar = findViewById( ;
setSupportActionBar(toolbar) ;
getSupportActionBar().setDisplayHomeAsUpEnabled(true) ;
toolbar.setNavigationIcon(R.drawable.your_icon) ;
mToolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.your_icon2)

To change the color of the vector icon, go to your XML vector…. file. In this case, it will be your_icon.xml, which will look like this:

Note that we used these attributes to set the color of the vector:

android:[email protected]/your_color

Edit: You cannot use a color from your color.XML file or anywhere else, the color must be shifted directly into the Vector XML…. file so it looks like this:


Solution no. 6:

All of the above solutions worked for me in API 21 and beyond, but not in API 19 (KitKat). A little tweak did the trick for me in previous versions. Rate Widget.Holo instead of Widget.AppCompat.

Solution no. 7:

Insert the default theme in this line;


Solution no. 8:

if you want to change the menu icons, the arrow icon (save/recycle) and the 3-dot icon, you can use android:tint

Solution no. 9:

What theme you used in the activity, add a line of code below.

for white


for black


Solution no. 10:

To change the color of the menu options, you can select

Replace the nice toCreateOptionsMenu (menu: Menu ?): Boolean {
menuInflater.inflate(, menu)

menu ?.forEach {

return where

Good luck!

 custom action bar androidandroid toolbar custom view examplesetsupportactionbar in fragmentandroid toolbar back buttonhow to get action bar in androidadd button in title bar androidandroidx toolbarandroid custom toolbar layout exampleandroid toolbar errorcustom toolbar android kotlinandroid material design status bar colorchange color primary dark androidstatus bar android studiolight status bar androidandroid toolbar example stackoverflowtoolbar in android javatpointandroidx.appcompat.widget.toolbar exampletoolbar with back button in android exampletoolbar android javatpointhow to change action bar icon color in androidchange toolbar home icon androidhow to change overflow menu icon in androidhow to change toolbar icon color androidtoolbar home icon change colorhow to change option menu icon color in androidandroid change three dots menu icon color programmaticallyhow to change navigation icon in android

You May Also Like

How To Speed Up Your Tablet (in 12-Ways)

Want to speed up your Android tablet? Here’s how to speed up…

Upcoming Apple Mobile Phones In 2021

Introduction According to my research, there are rumors that Apple could release…

How to check PC specs in Windows 7?

Errors often occur when starting a new driver or when the screen…

A Look Inside the Dark Web and How to Protect Yourself

The Black Web is an ominous term for a mysterious online marketplace…