'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim wb, wb2 As WebView
Dim wvx As WebViewExtras
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Dim x As String : x = "<!DOCTYPE html PUBLIC " & Chr(34) & "-//W3C//DTD XHTML 1.0 Transitional//EN" & Chr(34) & " " & Chr(34) & "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & Chr(34) & ">"
wb.Initialize("wb")
Activity.AddView(wb, 0, 0, 100%x, 50%y-1dip)
wb2.Initialize("")
wvx.addJavascriptInterface(wb2, "B4A")
wvx.addWebChromeClient(wb2)
Activity.AddView(wb2, 0, 50%y, 100%x, 50%y)
wb2.LoadUrl("file:///android_asset/wb2_page.htm")
wvx.addJavascriptInterface(wb, "B4A")
wvx.addWebChromeClient(wb)
wb.LoadHtml("<html><head></head><body><br /><a href=" & Chr(34) & "javascript:void(0)" & Chr(34) & " onclick=" & Chr(34) & "B4A.CallSub('xTest', true, 'Test1')" & Chr(34) & ">Touch me 1</a><br /><a href=" & Chr(34) & "javascript:void(0)" & Chr(34) & " onclick=" & Chr(34) & "B4A.CallSub('xTest', true, 'Test2')" & Chr(34) & ">Touch me 2</a></body></html>")
wb.BringToFront
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub xTest(strTest As String)
Msgbox(strTest,"OK")
End Sub