aspose file tools*
The moose likes Android and the fly likes How to load image for Android ImageView from classpath? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to load image for Android ImageView from classpath?" Watch "How to load image for Android ImageView from classpath?" New topic
Author

How to load image for Android ImageView from classpath?

Franz van Betteraey
Greenhorn

Joined: Jun 20, 2007
Posts: 18
Hi,

I have an Android App which contains an external dependend jar library. This external library contains some png-bitmaps which I want to show on some ImageViews in my application.

Looking inside the apk file of my application I can find the images in a sub directory ("aq\img") as expected.

What is the best way to show an image (insight the classpath) on a ImageView.

I tried this



and this


but it did not work (I did not really expect it to be that simple). The image remains empty.

Thanks for help!

Regards Klaus
Daniel Trebbien
Ranch Hand

Joined: Jul 10, 2007
Posts: 48
Try:
Franz van Betteraey
Greenhorn

Joined: Jun 20, 2007
Posts: 18
Hi Daniel,

this works. Thank's a lot!

Regards
Klaus

PS: I also posted this question here:
http://stackoverflow.com/questions/4853695/how-to-load-image-for-android-imageview-from-classpath
I noticed that you have also an SO account. If you answer the question there I will give you the reputation points :-)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to load image for Android ImageView from classpath?