android webview实现唤起qq临时会话 androidwebviewqq在线咨询
程序员文章站
2024-03-17 08:22:28
...
安卓部分代码
页面html代码
class MyWebviewclient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, android.graphics.Bitmap favicon) { if (url.startsWith("mqqwpa")) { view.stopLoading(); Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(in); }else{ super.onPageStarted(view, url, favicon); } } } WebViewClient mWebViewClient = new MyWebviewclient(); webView.setWebViewClient(mWebViewClient);
页面html代码
location.href="mqqwpa://im/chat?chat_type=wpa&uin=954502368";