Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private helpview As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("helplay")
'helpview.LoadURL("file:///android_asset/helpfile.htm")
'helpview.LoadHtml("<html><body background='" & WebViewAssetFile("helpfile.htm") & "'></body></html>")
'helpview.LoadHtml("<html><body ='" & WebViewAssetFile("helpfile.htm"))
helpview.LoadHtml(WebViewAssetFile("helpfile.htm"))
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