0

If I have something such as:

TextView description_label;
description_label.setText("Information");

How can I choose/set the colour of the text. Eg. have 'Information' in green

towi
  • 21,587
  • 28
  • 106
  • 187
  • 3
    Try looking at the documentation for the object in question before you post here. Lots of times these simple questions can be answered there Ex. http://developer.android.com/reference/android/widget/TextView.html – dymmeh Feb 26 '13 at 20:20
  • you may have a look at these threads http://stackoverflow.com/questions/4602902/how-to-set-text-color-of-textview-in-code and http://developer.android.com/reference/android/graphics/Color.html – William Kinaan Feb 26 '13 at 20:30

2 Answers2

3

Call description.setTextColor(). Or use android:textColor in the xml.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
0
TextView description_label;
description_label.setTextColor(Color.GREEN);
description_label.setText("Information");
JRowan
  • 6,824
  • 8
  • 40
  • 59