I try to set the background color of a TableRow. Currently I have this in my XML file:
android:background="@color/buttonBackground"
and i work great. But when it run
row.setBackgroundColor(R.color.red);
the row disappears. Can someone explain why that is?
I believe you need to do:
Resources resource = context.getResources();
row.setBackgroundColor(resource.getColor(R.color.red)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With