how to set color in android programmatically code example
Example 1: android settextcolor programmatically
mTextView.setTextColor(Color.parseColor("#bdbdbd"));
Example 2: android use attribute color programmatically
TypedValue typedValue = new TypedValue();
Theme theme = context.getTheme();
theme.resolveAttribute(R.attr.theme_color, typedValue, true);
@ColorInt int color = typedValue.data;