Мне нужно изменить цвет значка меню , я пробовал много способов, которые нашел, но ни один из них не работает
navigationView.getMenu().getItem(i).getIcon().setTint(ContextCompat.getColor(context, R.color.colorPrimary));
или
Drawable drawable = navigationView.getMenu().getItem(i).getIcon();
if(drawable != null) {
drawable.mutate();
drawable.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
SpannableString s = new SpannableString(name);
s.setSpan(new ForegroundColorSpan(Current_Theme.getInt("custom_button_arrow",ContextCompat.getColor(context, R.color.custom_button_arrow))), 0, s.length(), 0);
navigationView.getMenu().getItem(i).setTitle(s);
}
или
navigationView.getMenu().getItem(i).getIcon().setColorFilter(ContextCompat.getColor(context, R.color.colorPrimary), PorterDuff.Mode.SRC_IN);
или
Drawable mWrappedDrawable = drawable.mutate();
mWrappedDrawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(mWrappedDrawable, Color.RED);
DrawableCompat.setTintMode(mWrappedDrawable, PorterDuff.Mode.SRC_IN);
navigationView.getMenu().getItem(i).setIcon(mWrappedDrawable);
, пожалуйста, помогите мне