谁能告诉我如何在默认 webview 中打开 URL。我正在使用下面的代码,但它不起作用。它仍在提示选择意图。此代码在我的三星 S2 智能手机中运行良好。但不是在 Galaxy 平板电脑中。
browser.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//check for key strings in URL to determine next action.
int useNativeIntent = 0;
int bolDone = 0;
//allow loading of this URL
if(useNativeIntent == 0){
showProgress("Loading..","This may take a moment if you have a slow internet connection.");
loadBrowser(url);
}
return true;
}
//loadBrowser
public void loadBrowser(String theUrl){
if(browser != null){
try{
browser.loadUrl(theUrl);
}catch(Exception je){
hideProgress();
showAlert("Error Loading?","There was a problem loading some data. Please check your internet connection then try again.");
}
}
}