On May 15, 7:07 am, skink <[email protected]> wrote:

> BitmapDrawable bd = (BitmapDrawable) res.getDrawable(R.drawable.name2)
>
> and then:
>
> bd.getBitmap() IIRC

Ha, that did the trick. Apparently Resources.getDrawable() works with
an XML drawable proxy, but BitmapFactory.decodeResource() does not.

Unless someone has a good explanation why this would be so, I'm
inclined to call that a bug and write it up at b.android.com. Anyone?

FWIW, my final XML syntax looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android";
        android:src="@drawable/name1"></bitmap>

I'm not sure if the android namespace is required, but it works like
this, and it's probably good practice.

String

-- 
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