Actually you don't even need state_selected="false" in the first case.
This code here is just as good as my previous code:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android";>
        <item
                android:state_pressed="true"
                android:drawable="@drawable/list_item_pressed"/>
        <item
                android:state_selected="true"
                android:drawable="@drawable/list_item_focused"/>
        <item
                android:drawable="@drawable/transparent"/>
</selector>

Really simple and clean. I just can't get DPAD_CENTER press to work!

Kev

On Mar 20, 8:33 pm, lavanya <[EMAIL PROTECTED]> wrote:
> Hi,
> Thanks for the help Megha.Got what I wanted.
>
> <?xml version="1.0" encoding="utf-8"?>
> <selector xmlns:android="http://schemas.android.com/apk/res/android";>
> <item
> android:state_focused="true"
> android:state_pressed="false"
> android:state_selected="true"
> android:drawable="@drawable/blue"
>
> />
> <item android:state_focused="true"
> android:state_pressed="true"
> android:drawable="@drawable/green" />
>
> <item android:state_focused="false"
>  android:state_pressed="true"
> android:drawable="@drawable/silver" />
>
> <item android:state_selected="true"
> android:drawable="@drawable/lightyellow"
> />
>
> <item
> android:drawable="@drawable/lightgreen"
>  />
>
> </selector>
>
> If I use the code above things seem to work.However,if I declare the
> colors directly (as in my previous post) I get an error.Maybe its
> because a drawable can only reference other drawables?Anyways,thanks
> again.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to