Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim WebViewExtras1 As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layoutMain")
' onClick="javascript:B4A.CallSub('buttonClick', false);
' add the B4A javascript interface to the WebView
WebViewExtras1.addJavascriptInterface(WebView1, "B4A")
Dim html As String = $"<html>
<body>
<form >
Name: <input type="text" id="FirstName" name="FirstName" value="John" ><br>
Email: <input type="email" id="email" name="Email" value="johndoe@somewhere.com"><br>
<button type="button" onClick="javascript:B4A.CallSub('check_data', false, document.getElementById('FirstName').value, document.getElementById('email').value);">Next</button>
</form>
</body>
</html>"$
' now load a web page
WebView1.LoadHtml(html)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub check_data(var1 As String, var2 As String)
Log($"check_data(${var1}, ${var2})"$)
End Sub