Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to load image for Android ImageView from classpath?

 
Franz van Betteraey
Greenhorn
Posts: 20
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:
 
Franz van Betteraey
Greenhorn
Posts: 20
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :-)
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic