0
我想仅在应用程序中显示任何网页,而不是在浏览器中显示。 我已经使用了下面的代码,但它会打开浏览器。如何仅在Android应用程序中显示android中的网页
web = (WebView)findViewById(R.id.web_vieww);
web.loadUrl("http://www.google.co.in/");
我想仅在应用程序中显示任何网页,而不是在浏览器中显示。 我已经使用了下面的代码,但它会打开浏览器。如何仅在Android应用程序中显示android中的网页
web = (WebView)findViewById(R.id.web_vieww);
web.loadUrl("http://www.google.co.in/");
web = (WebView)findViewById(R.id.web_vieww);
web.loadUrl("http://www.google.co.in/");
web.setWebViewClient(new MyWebViewClient());
Define MyWebViewClient();
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return false;
}
}
你应该设置为WebViewClient用的WebView中重写'用的WebView避免对重定向或我已经使用这个还没有,但工作的任何链接点击或网页视图网址 – 2015-02-10 07:54:52
的变化打开默认浏览器shouldOverrideUrlLoading' .. 。web.setWebViewClient(新WebViewClient(){ \t \t @覆盖 \t \t公共布尔shouldOverrideUrlLoading(的WebView视图,字符串URL) \t \t { \t \t \t url =“http://www.google.co.in”; \t \t view.loadUrl(url); \t \t return true; \t \t} \t \t}); – abhi 2015-02-10 07:56:00
不工作意味着什么?因为同样工作正常,当我试着 – 2015-02-10 08:05:22