File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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?
 
Similar Threads
Three questions about images
image not visible untill resize
How to add text to gridview
Double tap to zoom on ImageView
How I can do similar thing what in Google Googles app?