I have show Array in listview. with black text color.
if i using android.R.color.black it will give runtime error.
this is my code.
list1 =(ListView)findViewById(R.id.scoreView1);
list2 = (ListView)findViewById(R.id.scoreView2);
for (int i = 1; i <= 3; i++) {
datalist1.add("Qustion "+ i + " Correct");
}
for (int i = 4; i <= 6; i++) {
datalist2.add("Qusetion "+ i + " Correct");
}
list1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,R.color.TextColor,datalist1));
list2.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,android.R.id.text1,datalist2));
my XML:
<resources>
<color name="Background">#E2E2E2</color>
<color name="TextColor">#040404</color>
<color name="White">#FFFFFF</color>
<color name="Black">#000000</color>
<color name="Red">#FF0000</color>
<color name="Green">#4AA02C</color>
</resources>
Any suggestion?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…