Programmatically change color of shape in layer list
How can I programmatically change the color ( #000000 ) of a shape in a layer list? Here is my layer list: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#000000" /> // CHANGE THIS COLOR </shape> </item> <item android:left="5dp"> <shape android:shape="rectangle"> <solid android:color="@color/bg" /> </shape> </item> </layer-list> First of all you need to assign id to you layer-list item. <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- First assign id to the list item--> <item