public class ListViewDemoActivity extends Activity { // private ListView listView;
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
TextView tv = new TextView(this); tv.setText("Test set TextView's color."); //方案一:通过ARGB值的方式 /** * set the TextView color as the 0~255's ARGB,These component values * should be [0..255], but there is no range check performed, so if they * are out of range, the returned color is undefined */ // tv.setTextColor(Color.rgb(255, 255, 255)); /** * set the TextView color as the #RRGGBB #AARRGGBB 'red', 'blue', * 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', * 'lightgray', 'darkgray' */ tv.setTextColor(Color.parseColor("#FFFFFF"));