Hi Gurus,
I have set a Webview control on one of my forms to navigate to a URL from within a code module, the code runs through with no errors and the URL is displayed as it should, but the 'PageFinished' event never fires. I am calling the code in the code module from my Main Activity. Any idea what I am doing wrong? Please help!
This is my code in the code module:
I have set a Webview control on one of my forms to navigate to a URL from within a code module, the code runs through with no errors and the URL is displayed as it should, but the 'PageFinished' event never fires. I am calling the code in the code module from my Main Activity. Any idea what I am doing wrong? Please help!
This is my code in the code module:
B4X:
Public Sub NavigateToGoogle()
'Load the parent form containing my Webview control.
MainActivity_.RemoveAllViews
MainActivity_.LoadLayout(strWebBrowserParentForm_)
WebBrowser.Initialize("WebBrowser") 'WebBrowser is declared in Class_Globals in the code module like this: Private WebBrowser As WebView
WebBrowser = MainActivity_.GetView(0) 'Get my Webview control.
'Make sure the Webview control is set at 100%
Dim Obj1 As Reflector
Obj1.Target = WebBrowser
Obj1.RunMethod2("setInitialScale", "100", "java.lang.int")
WebBrowser.LoadUrl("http://www.google.com")
End Sub
Public Sub WebBrowser_PageFinished (Url As String)
'...................this never fires!!!!
End Sub