I have an Activity with a webview and a javascript interface on the java side.I would like to write a method in Java that can accept a json paramater from the webview.
@JavascriptInterface
public String test(Object data) {
Log.d("TEST", "data = " + data);
}
on my webview javascript I call:
MyAPI.test({ a: 1, b: 2 });
but the data variable is null.
How can I pass JSON objects from webview javascript into native method?
Thanks