In the past few days, I have been trying to introduce the wireless Taobao page into the webview. I found that after clicking on the product details to enter the page, I cannot return.
At first, I followed what most people on the Internet said to display the link in the same webview. Page, thus overloading the shouldOverrideUrlLoading method of WebClient
mWebView = (WebView) findViewById(R.id.webView); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } });
mWebView = (WebView) findViewById(R.id.webView); mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); } }); WebSettings webSettings = mWebView.getSettings(); //支持js webSettings.setJavaScriptEnabled(true); //支持对网页缩放 webSettings.setSupportZoom(true); //支持android4.0 webSettings.setBuiltInZoomControls(true); //默认缩放模式 webSettings.setDefaultZoom(ZoomDensity.CLOSE); mWebView.setInitialScale(100); //载入url