I am trying get a var from a webview but I only can modify like this:
browser.loadUrl("javascript:var x = document.getElementById('login').value = 'something';");
but I need get any js var like this :
String myAndroidvar = browser.loadUrl("javascript:var x = document.getElementById('login').value");
but this syntax is incorrect, I need the correct method.
You have to add a javaScriptInterface to you webview. See this blog for a decent description. You can also get stuff from javascript by calling an interface function you defined using: