Hi Lavanya,
Please see Romain's response in the thread below for the correct way to use
ColorStateList:
http://groups.google.com/group/android-developers/browse_thread/thread/1906f24707594f67/0714e077e25d63a6
You may also open a documentation bug in the android issue tracker, for
clarifying this in the documentation.
Thanks,
Megha
On Thu, Mar 20, 2008 at 2:20 AM, lavanya <lava...@gmail.com> wrote:
Hi Megha,
Thanks for the link.Just what I was looking for.
I created a file called custombackground.xml under /drawable :
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="#5080"/>
<item android:state_pressed="true" android:state_enabled="false"
android:color="#5008" />
<item android:state_enabled="false" android:color="#2800" />
<item android:state_active="true" android:color="#2008" />
<item android:color="#2080"/>
</selector>
Then in /layout/row.xml this is the code i added:
<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/SpecialText"
android:background="@drawable/custombackground"
/>
I am getting the following error:
Binary XML file line#2:
Error inflating class java.lang.reflect.Constructor
Do you know what I am doing wrong?Thanks.