Hello,
I know that this question was already posted here one or two years ago. Unfortunately, none of the proposed solutions, in this forum, and around the web, have worked.
I have statics html pages, that have some <img src="picture.png">, that I display in a webview. I have no other solution than that.
At launch, I copy all the files (html, png) in the DirInternal (I tried also DirDefaultExternal).
I set every flags I found :
Then I load the page :
Links between page works, but every pictures appears as a broken icon.
Thanks.
I know that this question was already posted here one or two years ago. Unfortunately, none of the proposed solutions, in this forum, and around the web, have worked.
I have statics html pages, that have some <img src="picture.png">, that I display in a webview. I have no other solution than that.
At launch, I copy all the files (html, png) in the DirInternal (I tried also DirDefaultExternal).
I set every flags I found :
B4X:
Dim ws As WebSettings
ws = wve.GetSettings
ws.SetAllowContentAccess(True)
ws.SetAllowFileAccess(True)
ws.SetBlockNetworkImage(False)
ws.SetBlockNetworkLoads(False)
ws.SetLoadsImagesAutomatically(True)
ws.SetSupportZoom(False)
ws.SetAppCacheEnabled(True)
Dim joWebview As JavaObject = WebView1
Dim joSettings As JavaObject = joWebview.RunMethod("getSettings", Null)
Dim r As Reflector
r.Target = joSettings
r.RunMethod2("setAllowUniversalAccessFromFileURLs", True, "java.lang.boolean")
r.RunMethod2("setDomStorageEnabled", True, "java.lang.boolean")
r.RunMethod2("setMixedContentMode", 0x00000000, "java.lang.int")
r.RunMethod2("setAllowFileAccess", True, "java.lang.boolean")
r.RunMethod2("setAllowFileAccessFromFileURLs", True, "java.lang.boolean")
Then I load the page :
B4X:
Dim x As XUI
Dim url As String = x.FileUri(File.DirInternal, "index.htm")
WebView1.LoadUrl(url)
Links between page works, but every pictures appears as a broken icon.
Thanks.