addJavascriptInterface()
Adds a JavascriptInterface to a WebView.
The JavascriptInterface is a Java object with methods that can be executed using javascript in your WebView.
The Java object can execute Subs in your B4A application.
Click HERE to call a Sub in the B4A demo code.
Click HERE to call a Sub in the B4A demo code that will change the height of the WebViews in this demo.
Click HERE to call a Sub in the B4A demo code which will return a string to this page.
A B4A Sub can only return a (string) value to the javascript if the CallSub() method is passed boolean false as callUIThread.
If the B4A Sub modifies the activity UI it cannot return a value to the calling javascript.
Back to index page