I''m using a drawable for the cells in my table layout in my Android application. I wanna change the cell colors on click event. Is it possible to change the color of the drawable in run time. my drawable is,
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape= "rectangle" >
<solid android:color="#FFFFFF"/>
<stroke android:width="1dp" android:color="#483D8B"/>
</shape>
And I wanna change the white color "#FFFFFF" with the click event. can java edits the color in the XML drawable file. Is it possible. I just edited the background color and it dispersers the borders of the drawable.
String StatusColor=GetColor(Retailer_x.getStatus());
Stts.setBackgroundColor(Color.parseColor(StatusColor));
need help. Thank you!!!!