I am trying to get some values from my webview with javascript and use them later in my application:
webview.evaluateJavascript("(function() { return (getsSomeValue()); })();", new ValueCallback<String>() {
@Override
public void onReceiveValue(String valueFromJS) {
//I can use valueFromJS here
System.out.println(valueFromJS); // prints the value
}
});
// but I need to use valueFromJS here...
Please help me to take that value out of the callback, so that I could use it.