Getting net::ERR_UNKNOWN_URL_SCHEME while calling telephone number from HTML page in Android
2015-08-17 17:09
671 查看
I am getting "net::ERR_UNKNOWN_URL_SCHEME" while calling a telephone number option from an HTML page in Android. Do I need to add any permission(s) in the manifest to get this working? I haven't added anything in the manifest so far. Here's the HTML Code:
The following should work and not require any permissions in the manifest (basically override shouldOverrideUrlLoading and handle
links separately from tel, mailto, etc.):
<a href="tel:+1800229933">Call us free!</a>
The following should work and not require any permissions in the manifest (basically override shouldOverrideUrlLoading and handle
links separately from tel, mailto, etc.):
mWebView = (WebView) findViewById(R.id.web_view); WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient(){ @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if( url.startsWith("http:") || url.startsWith("https:") ) { return false; } // Otherwise allow the OS to handle things like tel, mailto, etc. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity( intent ); return true; } }); mWebView.loadUrl(url);
相关文章推荐
- android中使用gdbserver调试c程序
- Android_如何查看应用签名信息
- android加密解密算法之3DES算法用例
- android
- android AudioManager类 详解
- 深入讲解Android中Activity launchMode
- Android 下拉刷新上拉加载 多种应用场景 超级大放送(上)
- androidのadb命令终端实时打印cpu资源
- android listview滚动 edittext 数据就变了
- Android Studio 快捷键
- Android : onTouch 次序
- Android动画
- Android Development
- Android 如何实现屏幕转换方向
- android studio 编码
- Android Context的startService方法如何使用?
- Android 用户表单融合各类简易控件以及融入FloatingActionButton以及butterknife
- android studio 快捷键
- Android 用户表单融合各类简易控件以及融入FloatingActionButton以及butterknife
- Android实现二维码扫描登录网页