Dim WebView1 As FlingableWebView
Private myInterface As WebViewExtras
Private Sub B4XPage_Created (Root1 As B4XView)
myInterface.Initialize(WebView1)
End Sub
Sub WebView1LoadHtml
WebView1.LoadHtml("<html><body>Hello world!</body></html>")
myInterface.AddJavascriptInterface(WebView1,"B4A")
End Sub
Private Sub BShare_Click
Dim jsStatement As String = "B4A.CallSub('processHTMLShare', true, document.documentElement.innerText)"
myInterface.executeJavascript( jsStatement)
End Sub
Sub processHTMLShare(html As String)
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
in.PutExtra("android.intent.extra.TEXT", html )
in.SetType("text/plain")
in.WrapAsIntentChooser("Share")
StartActivity(in)
End Sub