Is there an equivalent to loadDataWithBaseURL for the WebView?
I'm loading data from an external URL that is not under my control (with permission of course). Without setting the BaseURL images etc are not displayed because relative URLs are used.
Thanks for posting this solution, this was required when we needed to loadHTML from a database that was from a live web site with relative image links. Worked perfectly!
Sub LoadDataWithBaseUrl(wv As WebView, BaseUrl As String, Html As String)
Dim jo As JavaObject = wv
jo.RunMethod("loadDataWithBaseURL", Array As Object(BaseUrl, Html, "text/html", "UTF8", null)
End Sub
Sub LoadDataWithBaseUrl(wv As WebView, BaseUrl As String, Html As String)
Dim jo As JavaObject = wv
jo.RunMethod("loadDataWithBaseURL", Array As Object(BaseUrl, Html, "text/html", "UTF8", null)
End Sub
I used the following to solve my issue, is there any advantages or disadvantages between these two techniques?
B4X:
Dim r As Reflector
r.Target = wv1
r.RunMethod4("loadDataWithBaseURL", Array As Object ("http://THEDOMAIN", myHTML, Null, "UTF-8", Null), Array As String("java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String"))