Hi
I try to open the html file (elem2.html) in webview.
I get a blank page. In which directory do I need to place the html file (elem2.html)?
Do I do it well at all?
I try to open the html file (elem2.html) in webview.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
WebView1.LoadHtml($"<img src="${WebViewAssetFile( "elem2.html")}"/>"$)
End Sub
Sub WebViewAssetFile (FileName As String) As String
Dim jo As JavaObject
jo.InitializeStatic("anywheresoftware.b4a.objects.streams.File")
If jo.GetField("virtualAssetsFolder") = Null Then
Return "file:///android_asset/" & FileName.ToLowerCase
Else
Return "file://" & File.Combine(jo.GetField("virtualAssetsFolder"), _
jo.RunMethod("getUnpackedVirtualAssetFile", Array As Object(FileName)))
End If
End Sub
I get a blank page. In which directory do I need to place the html file (elem2.html)?
Do I do it well at all?