Sub Process_Globals
End Sub
Sub Globals
Dim WebViewExtras1 As WebViewExtras
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim WebView1 As WebView
WebView1.Initialize("")
WebViewExtras1.Initialize(WebView1)
Dim WebChromeClient1 As DefaultWebChromeClient
WebChromeClient1.Initialize("WebChromeClient1")
WebViewExtras1.SetWebChromeClient(WebChromeClient1)
Activity.AddView(WebViewExtras1, 0, 0, 100%x, 100%y)
WebViewExtras1.LoadUrl("http://www.b4x.com/android/forum/threads/catching-error-messages-from-webview-using-webviewextras.33437/#post-195766")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub WebChromeClient1_ConsoleMessage(ConsoleMessage1 As ConsoleMessage) As Boolean
Dim Message As StringBuilder
Message.Initialize
Message.Append("WebChromeClient1_ConsoleMessage: ")
Select ConsoleMessage1.MessageLevel
Case ConsoleMessage1.DEBUG
Message.Append("DEBUG")
Case ConsoleMessage1.ERROR
Message.Append("ERROR")
Case ConsoleMessage1.Log ' the compiler insists on changing LOG to Log!
Message.Append("LOG")
Case ConsoleMessage1.TIP
Message.Append("TIP")
Case ConsoleMessage1.WARNING
Message.Append("WARNING")
End Select
Log(Message.ToString)
Message.Initialize
Message.Append(ConsoleMessage1.Message)
Message.Append(" in ")
Message.Append(ConsoleMessage1.SourceId)
Message.Append(" (Line: ")
Message.Append(ConsoleMessage1.LineNumber)
Message.Append(")")
Log(Message.ToString)
Return True
End Sub