How to change the color of the Toolbar menu icon on Android? [duplicate]

1

By default it appears white, what I need is to put the background in White and the icon in orange, how could the color of the icon change?

    
asked by Didier 21.12.2017 в 03:28
source

1 answer

2

You can do it using a drawable and apply a color filter.

final Drawable menuIcon = getResources().getDrawable(R.drawable.ic_menu);
menuIcon.setColorFilter(getResources().getColor(R.color.orange), PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setHomeAsUpIndicator(menuIcon);
    
answered by 21.12.2017 в 08:20