Android Question addWebChromeClient

Tasyo28

Member
Licensed User
Hi,

I'm newly here in B4a and I'm trying to create a webapp using webview, i downloaded the WebViewExtras v1.42 and WebViewSettings v1.31 and I'm having error in this code saying addWebChromeClient is missing parameter...Please help thanks

Sub Globals
Dim WebView1 As WebView
Dim WebViewExtras1 As WebViewExtras
Dim WebViewSetting1 As WebViewSettings
End Sub

Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("WebView1")

WebView1.JavaScriptEnabled=True
WebViewExtras1.addJavascriptInterface(WebView1, "B4A") ' NOT ESSENTIAL
WebViewExtras1.addWebChromeClient(WebView1)
WebViewSetting1.setDatabaseEnabled(WebView1, True)
WebViewSetting1.setDOMStorageEnabled(WebView1, True)

Log("DefaultWebViewDatabasePath: "&WebViewSetting1.getDatabasePath(WebView1))
' the WebView will fail to create any databases if the database path is NOT set
WebViewSetting1.setDatabasePath(WebView1, "")
Log("NewWebViewDatabasePath: "&WebViewSetting1.getDatabasePath(WebView1))


Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
WebView1.LoadUrl("http://www.google.com")

End Sub
 

Tasyo28

Member
Licensed User
Thank you for your quick reply erel. Please see image below

upload_2017-12-11_15-50-52.png
 

Attachments

  • upload_2017-12-11_15-50-33.png
    upload_2017-12-11_15-50-33.png
    83.9 KB · Views: 229
Upvote 0

Tasyo28

Member
Licensed User
Thank you very much now no more error i just put it like this and it works no more missing parameter.

B4X:
 WebViewExtras1.addWebChromeClient(WebView1, True)
 
Upvote 0

Tasyo28

Member
Licensed User
oh is there any problem when i did not put "WebViewExtras1"? now i put only "True" so meaning
addWebChromeClient is not working? thank you for correction please advise as im new only on your system
 
Upvote 0
Top