I'm using shape attribute like this:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<solid
android:color="#FFFFFF" />
<corners
android:bottomRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>
and
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_textview">
</TextView>
If I change the color at runtime with the following method:
TextView.setBackgroundColor();
The shape I used is disappear. What should I do to change it with the proper way? Or should I must have to generate lots of shape for just different colors?
Thanks.