I tried to pass a string parameter to the web app javascript code. It's failed while passing a variable with the string value. But it works when we hardcode the data. Please let me know what's wrong with this.
Working hardcoded code:
mWebview.evaluateJavascript("cm.setData('N051783')", new ValueCallback<String>() {
@Override
public void onReceiveValue(String value3) {
Log.d(" setData Return Value"," setData Return... "+value3);
}
});
Not working code with string variable
mWebview.evaluateJavascript("cm.setData("+sub_data+")", new ValueCallback<String>() {
@Override
public void onReceiveValue(String value3) {
Log.d(" sub_data Return Value"," sub_data Return... "+value3);
}
});