I have a TextView
<TextView android:id="@+id/tv_rowMainFragment_pushBadge" android:layout_width="30dp" android:layout_height="30dp" android:layout_marginLeft="20dp" android:layout_marginRight="10dp" android:background="@drawable/shape_badge" android:gravity="center" android:lines="1" android:paddingLeft="10dp" android:paddingRight="10dp"/> I pass drawable
android:background="@drawable/shape_badge" <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="@color/color_white"/> </shape> Now my TextView round and has a white background color.
Now the question is how to dynamically change the background color and at the same time leave a round shape?