试下这个.
publicclassMyTextViewextends Activity {
private TextView mTextView;//声明TextView对象
/** Called when the activity is first created. */
Override
publicvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mTextView = (TextView)findViewById(R.id.tv);//取得TextView对象
mTextView.setText("我的第一个文本");//设置TextView显示的内容
mTextView.setTextColor(Color.GREEN);//设置TextView的颜色
mTextView.setBackgroundColor(Color.WHITE);//设置TextView的背景色
}
}