This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 44
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 :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to load image for Android ImageView from classpath?