Trying to load and view some HTML that contains an image (question.gif) but when I compile I get the message file question.gif not used and the loadhtml command does not work. is there something I have missed. I have added the file using the file manager.
Trying to load and view some HTML that contains an image (question.gif) but when I compile I get the message file question.gif not used and the loadhtml command does not work. is there something I have missed. I have added the file using the file manager.
A more recent update - it looks like that in later versions of Android you can no longer access items from the DirAssets folder in a WebView LoadHTML statement. I guess that this might be a security issue.
This indirect method works though if you copy the file to the internal directory first though.
B4X:
File.Copy(File.DirAssets,"ic_menu_home.png",File.DirInternal,"ic_menu_home.png")
Dim HTML As String
HTML=$"
<HTML>
<BODY>
<img src='file://${File.DirInternal}/ic_menu_home.png' >
Use the Home Icon to return to the Account Summary.
</BODY>
</HTML>
"$
WebView1.Enabled=True
WebView1.Visible=True
WebView1.Invalidate
WebView1.LoadHtml(HTML)