原文链接 http://www.xsmile.net/?p=583

Android 使用MMS彩信或者Gmail发送图片


Intent i = new Intent(Intent.ACTION_SEND);i.putExtra(Intent.EXTRA_STREAM,imageUri);//这里必须是图片的urii.setType("image/jpeg");startActivity(Intent.createChooser(i,TITLE_TIP));//TITLE_TIP是弹出的选择程序处理的文字标题



==================================================
Android 使用短信或者Gmail发送文字


Intent intent = new Intent(Intent.ACTION_SEND);intent.setType("text/plain");intent.putExtra(Intent.EXTRA_SUBJECT,SOMETHING_TITLE)//Gmail的邮件主题,可选intent.putExtra(Intent.EXTRA_TEXT,SOMETHING_TEXT_BODY);//文本内容startActivity(Intent.createChooser(intent,TITLE_TIP);//弹出的选择程序处理的文字标题


这样所有intent-filter的action设置为android.intent.action.SEND的Activity都将作为被选择程序出现在列表中。

更多相关文章

  1. android 9.0 拍照 相册选择 图片 裁切后进行 上传到服务器(亲测可
  2. Android学习08-----Android中的基本控件(下)(6)_菜单:Menu和隐式抽
  3. Android(安卓)通过initrc控制命令、服务启动时间
  4. android 选择layout的规则
  5. Android仿微信图片选择器(二)
  6. android listview(每个item包含图片及文字)
  7. Android工具类ImgUtil选择相机和系统相册
  8. Android(安卓)使用 MuMu模拟器 进行程序调试
  9. APIcloud 按两次返回键退出程序,android按两次返回键退出程序

随机推荐

  1. Linux/Android——输入子系统input_event
  2. android 获取 内外存储设备路径疑问
  3. 19、从头学Android之Android的数据存储--
  4. 如何适应android碎片化的屏幕
  5. android string.setSpan
  6. Android(安卓)Launcher抽屉类SlidingDraw
  7. Java之IO流操作
  8. 如何实现Android桌面小部件(二)
  9. [转载]Android触屏滑动事件总结 (2011-08
  10. android 异步显示View