How can I set Text Color of a text view to #bdbdbd
programatically?
Use,..
Color.parseColor("#bdbdbd");
like,
mTextView.setTextColor(Color.parseColor("#bdbdbd"));
Or if you have defined color code in resource's color.xml
file than
(From API >= 23)
mTextView.setTextColor(ContextCompat.getColor(context, R.color.<name_of_color>));
(For API < 23)
mTextView.setTextColor(getResources().getColor(R.color.<name_of_color>));