In Android Studio, I want to change the color of a portion of a item in the Navigation Drawer. In the image attached Navigation Drawer, I want the word "PRO" to appear red.
Use a spannable string:
MenuItem item = (MenuItem) navigation.getMenu().findItem(R.id.miItem);
String str = item.getTitle().toString();
SpannableString span = new SpannableString(str);
span.setSpan(new ForegroundColorSpan(Color.RED), str.length() - 3, str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
item.setTitle(span);
replace
navigation
with your NavigationView
variable
miItem
with the corresponding MenuItem
's id