I just want to set the colour of the vector asset. I have searched for it but doesn't seem to be work for me. and I don't want to change it from XML, I want to change it in my MainActivity.java, or I say programmatically.is there any method for this?
Here is my Code
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuItem menuItem = menu.add("Image");
menuItem.setIcon(R.drawable.ic_camera_alt_black_24dp);
menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
//something like this
//menuItem.setIconColor(Color.WHITE);
return true;
}
I am searching something for formatting the icon colour.
I mentioned it that I don't want to do this using XML.And as well android:tint
does not work for me