You can do this only from an XML file too.
Create a color.xml
file in the values folder:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="textbody">#ffcc33</color>
</resources>
Then in any XML file, you can set color for text using,
android:textColor="@color/textbody"
Or you can use this color in a Java file:
final TextView tvchange12 = (TextView) findViewById(R.id.textView2);
//Set color for textbody from color.xml file
tvchange1.setTextColor(getResources().getColor(R.color.textbody));