Continuation of 'Wrong File/ Contents' thread as requested.
I'm trying to set/ reset the background image of a webview by loading this HTML:
DIImagePath is the path/ filename to the image file.
I've tried both 'loadurl' and 'loadhtml' but on re-loading (i.e. loading the html the second or third time with different imagepaths) the image isn't correct. It reverts to previous images.
To prove the imagepath is correct I have tried loading it to an imageview just before the loadurl/ loadhtml. The image in the imageview is always correct.
I've tried initializing the wv just before loading the html but this just leaves a blank screen, no image.
I've tried clearing the background first with:
but the wrong image is still displayed.
I'm trying to set/ reset the background image of a webview by loading this HTML:
B4X:
File.WriteString(rpDIRoot, "index.html", _
"<html>" & CRLF & _
"<style type=""text/css"">" & CRLF & _
"<!--" & CRLF & _
"body {" & CRLF & _
"background-image: url(" & DIImagePath & ");" & CRLF & _
"background-repeat: no-repeat;" & CRLF & _
"background-size: 100% 100%;" & CRLF & _
"}" & CRLF & _
"-->" & CRLF & _
"</style>" & CRLF & _
"</body>" & CRLF & _
"</html>")
I've tried both 'loadurl' and 'loadhtml' but on re-loading (i.e. loading the html the second or third time with different imagepaths) the image isn't correct. It reverts to previous images.
To prove the imagepath is correct I have tried loading it to an imageview just before the loadurl/ loadhtml. The image in the imageview is always correct.
B4X:
If Not(testpicbox.IsInitialized) Then testpicbox.Initialize("")
testpicbox.RemoveView
Activity.AddView(testpicbox, 0, 0, 400, 300)
testpicbox.Bitmap = LoadBitmapSample("", DIImagePath, 400, 300)
testpicbox.BringToFront
I've tried clearing the background first with:
B4X:
"<html>" & CRLF & _
"<body>" & CRLF & _
"</body>" & CRLF & _
"</html>"