Home » Android » java – Javascript square bracket notation couldn't be evaluated properly while using an android webview. Any advice to fix it?-Exceptionshub

java – Javascript square bracket notation couldn't be evaluated properly while using an android webview. Any advice to fix it?-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I’m using android webview and want to make dynamic function calls over the Javascript Interface. My interface’s name is AndroidBridge. And here is my code:

AndroidBridge[key](values[key]);

It works properly on the browser. But when it comes to my webview, is throwing the error below:

Error connecting controller TypeError: AndroidBridge[key] is not a function [object Object]"

Any advice to jump over that issue?

How to&Answers: