ZoobTheSimian wrote:
> Hi, all.
> 
> I'm having a problem with setImageURI on my ImageView objects. I was
> using setimageResource(R.drawable.x), which was working fine, but now
> I'm trying to change over to using URIs so that I can be more flexible
> about my image source (not constrained to pre-packaged images).
> 
> I'm using ImageView.setImageURI(uri), where uri is (for example)
> android.resource://com.example.hellogridview/2130837520, which I
> created by doing Uri.parse("android.resource://
> com.example.hellogridview/" + R.drawable.x). I took this method from
> my MediaPlayer, where I created URIs for R.raw wav files from this
> path.
> 
> It's not throwing any errors that I can see, but it's just displaying
> blank images. The images are ~150px each way and I'm displaying them
> about half size - would that cause a problem?
> 
> Any ideas, please? :)

I remember some core Android team members giving me odd looks when I
referenced the android.resource Uri scheme in a previous email. I'm not
sure I would count on that scheme, as I suspect it's in a bit of a dusty
Android corner.

Moreover, while I appreciate the elegance of everything-is-a-Uri, there
is no question that different sources of data behave differently. You're
not going to want to call setImageURI() on an http:// URL, for example
-- you want to do the HTTP download in a background thread, cache the
result, etc. Technically, an HTTP Uri might work; practically, it's not
a good solution.

Hence, I'm not convinced the road you're travelin' down is necessarily
the best road.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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