我应该在此处删除错误?
webView.setWebViewClient(new WebViewClient(){
@Override
public void onPageFinished(WebView view, String url) {
swipe.setRefreshing(false);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) {
currentURL = urlNewString;
}//here is error for return type
});
答案 0 :(得分:0)
如果主机应用程序想要离开当前的WebView并处理url本身,则从WebViewClient设置返回类型为True,否则返回false。
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlNewString)
{
currentURL = urlNewString;
return true;
//return true load with system-default-browser or other browsers, false with your webView
}
答案 1 :(得分:0)
如果您想覆盖加载URI或true
,则必须返回false
。
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) {
currentURL = urlNewString;
return true; //or false
}