问题
I have three Fragment. I have sent a String(URL) from third Fragment to the First Fragment. First Fragment has a webView . I want to show website on the webView which I passes from third fragment./ But I am facing one problem It shows me Dialog to choose one browser rather than showing the URl on the webview. This is the code.
String url="http://www.hotelsearcher.net/";
Bundle args = getArguments();
if (args != null){
url = args.getString("url");
}
// url=FragmentC.url;
WebView webView= (WebView) V.findViewById(R.id.webView1);
WebSettings webViewSettings = webView.getSettings();
webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webViewSettings.setJavaScriptEnabled(true);
webViewSettings.setPluginState(PluginState.ON);
webView.loadUrl(url);
回答1:
Put this in webview:
webViewSettings.setWebViewClient(new WebViewClient());
来源:https://stackoverflow.com/questions/24558423/webview-loadurl-opens-browser-choice-dialog