public void getGetDataByUrl(String url) {
MainActivity.getInstance().runOnUiThread(new Runnable() {
@Override
public void run() {
getDataVebview(url);
}
});
}
@SuppressLint("JavascriptInterface")
public void getDataVebview(String url) {
_webView = new WebView(MainActivity.getInstance());
_webView.getSettings().setJavaScriptEnabled(true);
WebAppInterface webAppInterface = new WebAppInterface(MainActivity.getInstance());
_webView.addJavascriptInterface(webAppInterface, Constant.WEBAPP_JSI);
isPageMediaFinished = false;
_webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
if (isPageMediaFinished){
return;
}
isPageMediaFinished = true;
_webView.evaluateJavascript(Constant.GET_JSI_URL, new ValueCallback<String>() {
@Override
public void onReceiveValue(String value) {
if(value != null) {
//How to get data value in method setGetData
}
}
});
}
});
_webView.loadUrl(url);
如何获得&#34;价值&#34; getGetDataByUrl方法中方法getDataVebview的方法