Android Question WebView - image file warning

SteveTerrell

Active Member
Licensed User
Longtime User
B4A 6.31

I am probably doing something silly so any help appreciated.

I have a simple html file in the files folder.

Code:
<html><body bgcolor=#FFFFFF>
<h1> Title of the document </h1>
<br/>
<p2>
<input type="button" value="Hello" />
Hello world!
<br/>
<img src="file:///android_asset/RIMG1937c.jpg"/>
<br/>
Second line
<br/>
Third line
</p2>
</body>
</html>

This is displayed in a WebView with
Code:
    WebView1.LoadUrl("file:///android_asset/startup.html")

I also have
Code:
    #DebuggerForceStandardAssets: true
so that it works with the rapid debugger.

The picture "RIMG1937c.jpg" is also in the files folder.

The result i get when running the app depend upon whether or not i have added "RIMG1937c.jpg" to the files tab.
If it is just in the folder and not added to the tab the picture displays correctly but i get warning 14 - file not added to files tab.

If i add it to the files tab the picture is not displayed - just a place holder is shown.

It looks looks like <img src="file:///android_asset/RIMG1937c.jpg"/> is not the correct location when the file is added to the files tab. Does the path need changing or is something else wrong?
 
assets should be all lowercased
 
Upvote 0
Back
Top