I'm having a textview and its background is set using drawable resource.
<TextView
         android:id="@+id/label1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="Label1"
         android:textColor="#FFFFFF"
         android:background="@drawable/rounded_label"
         android:layout_below="@id/snippet"
         android:layout_toRightOf="@id/label"
         android:layout_alignParentBottom="true"
         >
rounded_label.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
  xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#000000"/>
    <corners android:radius="3px"/>
    <padding android:left="0dp"
        android:top="0dp" android:right="0dp" 
         android:bottom="dp" />
</shape>
The color assigned in <solid> must be performed in runtime using code not using XML?
Thanks in advance.