Discussion Forums  >  Images, Documents, File Locations

Replies: 3    Views: 194

chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
09/18/14 03:47 AM (7 years ago)

Android doesn't shows images in Custom HTML / Text

Hi, I have compiled my Android app, but when i test my app it doesn't shows images in Custom HTML / Text. I used this code for showing image: <p> <img src="bannerhome.png" /></p> <p> and then I've added bannerhome.png in res/drawable folder before compiling the app. What's wrong?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/18/14 08:25 AM (7 years ago)
You need to get a reference to the file path of the actual image. Try something like this: <img src = "file:///android_res/drawable/bannerhome.png" />
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
09/18/14 10:18 AM (7 years ago)
I've tried with: <img src = "res/drawable/bannerhome.png" /> but nothing.. Is this the path right?
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
09/18/14 10:38 AM (7 years ago)
Thanks Chris1, I tried the path you suggested and WORKS FINE!!! :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.