Basically I want get data I already have accessed from javascript and passing it to Java/Android so that I can work with it there.
/* An instance of this class will be registered as a JavaScript interface */
class MyJavaScriptInterface {
@SuppressWarnings("unused")
public void setX(String html){
Activity.this.x = html;
Toast.makeText(myApp, Activity.this.x, Toast.LENGTH_LONG).show();
}
}
this works but I want to be able to call the same Toast line anywhere and get the same result. Currently it only returns null/empty when not called through loading through webview.loadUrl("Javascript:"...
Any tips?