Android点击WebView网页中的email发送邮件调用:

webView.setWebViewClient(new WebViewClient() {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url) {url = url.replace("mailto:", "");// 邮箱正则表达式String check = "^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$";Pattern regex = Pattern.compile(check);Matcher matcher = regex.matcher(url);boolean isMatched = matcher.matches();if (isMatched) {Intent emailIntent = new Intent(Intent.ACTION_SEND);emailIntent.setType("plain/text"); // emailIntent.setType("message/rfc822");// //真机上使用String[] emailReciver = new String[] { url };// 设置邮件默认地址emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,emailReciver);// 设置邮件默认标题emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"");// 设置要默认发送的内容emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");// 调用系统的邮件系统startActivity(Intent.createChooser(emailIntent, "请选择邮件发送软件"));}return false;}});

更多相关文章

  1. Android(安卓)ListView SimpleAdapter ArrayList 数据更新问题 z
  2. Android(安卓)webview注入自己的js代码(js传入function等其他参数
  3. Android状态栏和虚拟导航栏的适配总结
  4. Android(安卓)JNI(NDK)开发总结
  5. Android主题theme和样式style总结
  6. 【Android(安卓)UI设计与开发】第06期:底部菜单栏(一)使用TabActivi
  7. WebView之js调用Android类的方法传递数据 - 依凡王子
  8. 【Android实战之旅 001】AsyncTask异步操作网络请求
  9. Unity调用Android原生Java代码以及Unity打开Android原生Activity

随机推荐

  1. Android(安卓)ListView 设置
  2. Android(安卓)imageView图片按比例缩放
  3. android 布局学习
  4. Android界面——LinearLayout和RelativeL
  5. android 几个常用命令
  6. 通过xml加载菜单Menus
  7. Android(安卓)源代码结构
  8. Android(安卓)imageView图片按比例缩放
  9. android Wifi自动连接
  10. Android系统自带主题样式(android:theme),An