アンドロイドのプログラムで背景色を設定することTextView
はうまくいかないようです。何かが足りない!
TextView et = new TextView(activity);
et.setText("350");
et.setBackgroundColor(R.color.white);
このファイル(colors.xml)もres/valuesフォルダーにあります
<resources>
<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
</resources>
[編集]:また、テキストの色を設定すると、TextViewが消えます。
TextView c1 = new TextView(activity);
c1.setTextColor(R.color.solid_red);
c1.setText("My Text");