On the PC end, We can click a URL link to start QQ. This is a good user jump experience. Very convenient.
The links used are as follows:
<A target = "_ blank" href = "http://wpa.qq.com/msgrd? V = 3 & uin = & site = qq & menu = yes"
> Click </a>
Replace 8888888 with your QQ number.
Can this be used in android? In fact, it can be done in the default browser (or UC. The experience is not that good when using custom webView.
We often reload the following setWebViewClient objects in WebView.
webView1.setWebViewClient(new WebViewClient() {public boolean shouldOverrideUrlLoading(WebView view, String url) {view.loadUrl(url);return true;}});
If you do so, you cannot jump to QQ. Why?
After capturing the sent request packet, I found that in the request of the http://wpa.qq.com, the actual request was also sent starting with mqqwpa: // im/chat.
Mqqwpa: // This Part of the URL is called the sechme part of the URL. It is similar to http: //, https: //, http: //, and https: // It is a webpage that can be opened. It is handled by webView, while others are handled by default. In this way, we can call QQ after clicking on the URL link.
Therefore, you need to overload the shouldInterceptRequest method to intercept other sechme processes.
As shown below:
webView1.setWebViewClient( (url.startsWith("http") || url.startsWith("https" =