Resources resources=getBaseContext().getResources(); int color=resources.getColor(R.color.colorAccent); String string=resources.getString(R.string.helloWorld); TextView textView= (TextView) findViewById(R.id.textView); textView.setBackgroundColor(color); textView.setText(string);
时间: 2024-12-06 03:51:07