mttkay / ignition

Kick-starts Android application development.
1.28k stars 290 forks source link

Setting an Android resource image URL #11

Closed saadfarooq closed 12 years ago

saadfarooq commented 12 years ago

Since I do have your undivided attention. I'm using RemoteImageView in a ListView. Most of the items are loaded over the web but I want to show a couple from a local resource.

Is there a way to specify this ?

It would be really awesome if I could just specify this as a URL from my adapter. I asked a question on StackOverflow. but none of the responses worked for me: http://stackoverflow.com/questions/9296999/android-reference-resource-drawable-as-a-url

mttkay commented 12 years ago

I don't understand. If you already deploy the image with your app, just use an ordinary ImageView? Every image you drop in the drawables folder becomes a resource that can be set via android:src.

saadfarooq commented 12 years ago

My bad.... I didn't to use an ImageView since then I would have to create a different layout and inflate it in the Adapter. However, I didn't realize that RemoteImageView already had a method to specify an Image to be loaded directly.

I just used the method and all was well. Apologies for the stupid issue.