How to modify layer list programmatically in Android?

Viewed 15038

I have a layer list set as a background to a Textview :-

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

<!-- Bottom 2dp Shadow -->
<item>
    <shape android:shape="rectangle" >
        <solid android:color="@android:color/black" />

        <corners android:radius="15dp" />
    </shape>
</item>

<!-- Blue Top color -->
<item
    android:bottom="1.5px"
    android:right="1px">
    <shape android:shape="rectangle" >
        <solid android:color="#2E93FA" />

        <corners android:radius="15dp" />
    </shape>
</item>

<solid android:color="#2E93FA" />

<corners
    android:radius="15dp" />

--> I need to show different colors in a listview for this layer list.

I need to modify the Second Item programmatically through code (dynamically). Can anyone help ?

1 Answers
Related