It is not the right way. Do not use @drawable-ldpi/, just keep the
same XML file, it will work. The system will find startstopin and
startstopout in the right drawable-XXX/ directory.

On Tue, Jan 5, 2010 at 11:24 PM, OldSkoolMark <[email protected]> wrote:
> In my res/drawable directory I have:
>
> <?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/startstopin" />
>     <item android:drawable="@drawable/startstopout" />
>  </selector>
>
> Works like a champ. I'm now trying to make my app work on small screen
> devices, so I created a res/drawable-ldpi directory, and populated it
> with the two pngs plus the corresponding selector file:
>
> <?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-ldpi/startstopin" />
>     <item android:drawable="@drawable-ldpi/startstopout" />
>  </selector>
>
> No love. I get:
>
> ... res\drawable-ldpi\startstopbuttonimageselector.xml:3: ERROR Error:
> No resource found that matches the given name (at 'drawable' with
> value '@drawable-ldpi/startstopin').
> ... res\drawable-ldpi\startstopbuttonimageselector.xml:5: ERROR Error:
> No resource found that matches the given name (at 'drawable' with
> value '@drawable-ldpi/startstopout').
>
> Isn't this the right way to specify ldpi specific button images? If
> default device xmls and pngs go in drawable, then ldpi xmls and pngs
> go in drawable-ldpi, right? Could these errors be the result of an
> inappropriate <supports-screens> element in my manifest file?
>
> Neither the api-demos in the samples (for any SDK version), or the
> newer samples including multires, have any multi res image button
> examples. In fact, I couldn't find any example where there was an xml
> file in a res/drawable-...
>
> Anyone see what I'm doing wrong and/or have a working example of how
> to specify resolution specific drawables for image buttons?
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to