AddJavascriptInterface: object method not found

I wrote a new example similar to WebView Demo, and registered my Java object with addJavascriptInterface () in webview. and in java script I can call java methods.

Later I changed the Android browser code and tried to add Object to javascript in the same way. but the members of the object are not available in javascript and I get a runtime error like

"Uncaught TypeError: Object com.android.browser.BrowserActivity$MyJavaScriptInterface@43bf7e b8 does not have a method 'launchPlayer'"

Where, as a method, launchPlayer is available in the MyJavaScriptInterface class.

Can someone tell me what is the difference in a browser application that stops exporting methods to Javascript.

+3
source share

Source: https://habr.com/ru/post/1761701/


All Articles