Android 调用系统的分享功能
2017-03-07 22:30
387 查看
原创文章,如有转载,请注明出处:http://blog.csdn.net/myth13141314/article/details/60781661
2.分享内容为图片:
效果图片:
有时候分享的功能比较简单,不需要集成第三地方的SDK,可以考虑利用Intent来实现简单的分享功能
1.分享内容为文字Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_TEXT, "要分享的文字内容"); shareIntent.setType("text/plain"); //设置分享列表的标题,并且每次都显示分享列表 startActivity(Intent.createChooser(shareIntent, "弹出的分享dialog的标题"));
2.分享内容为图片:
Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri); shareIntent.setType("image/*"); startActivity(Intent.createChooser(shareIntent, "弹出的分享dialog的标题"));
效果图片:
相关文章推荐
- Android调用系统自带的分享功能实例代码
- android 调用系统中分享功能
- Android调用系统分享功能总结
- Android 调用系统分享功能
- Android:调用系统分享功能
- Android调用系统分享功能以及createChooser的使用
- Android调用系统分享功能以及createChooser的使用
- Android调用系统分享功能以及createChooser的使用
- 探索Android调用系统的分享功能
- android调用系统的分享功能实现分享到短信,邮件和其他
- Android分享---调用系统自带的分享功能
- 探索Android调用系统的分享功能
- Android调用系统分享功能以及createChooser的使用
- Android:调用系统分享功能
- Android实现调用系统分享功能示例的总结
- Android调用系统分享功能以及createChooser的使用
- Android调用系统本身的分享功能
- 调用Android系统分享功能(可分享纯文本信息)
- Android:调用系统分享功能
- android 调用系统分享功能以及实现自定义分享