Issue
I have a png file in my package, and I just want to use it as the source for an image I am loading via html in a webview.
So far I have tried, this, this and this. None of which have actually worked.
Here is how I am adding the img tag to the html. Can anyone help me? I'm trying to build this for as early of an SDK version as possible (currently 4 [1.6])
String stringPath = "fie:///android_asset/chat_bubble.png";
addOn = String.format("<img src=\"%s\" >", stringPath);
Solution
(I assume you copied the code piece from your project.)
There is a typo:
String stringPath = "fie:///android_asset/chat_bubble.png";
should be
String stringPath = "file:///android_asset/chat_bubble.png";
And you didn't closed <img>
tag:
addOn = String.format("<img src=\"%s\" >", stringPath);
should be
addOn = String.format("<img src=\"%s\" />", stringPath);
Answered By - faradaj
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.