app 多图片分享至微信朋友圈
2016-04-05 18:12
393 查看
由于微信分享的sdk 只能一张图片,大多数情况想展示多个图片,怎么办? private static void shareMultiplePicture(Context context, File... files) {
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.tencent.mm",
"com.tencent.mm.ui.tools.ShareToTimeLineUI");
intent.setComponent(comp);
intent.setAction(Intent.ACTION_SEND_MULTIPLE);
intent.setType("image/*");
ArrayList<Uri> imageUris = new ArrayList<Uri>();
for (File f : files) {
imageUris.add(Uri.fromFile(f));
}
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
try {
((BaseActivity) context).startActivityForResult(intent, 0);
} catch (ActivityNotFoundException exception) {
ToastUtil.showToast(context, "没安装微信。");
} catch (Exception e) {
ToastUtil.showToast(context, "异常");
}
}
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.tencent.mm",
"com.tencent.mm.ui.tools.ShareToTimeLineUI");
intent.setComponent(comp);
intent.setAction(Intent.ACTION_SEND_MULTIPLE);
intent.setType("image/*");
ArrayList<Uri> imageUris = new ArrayList<Uri>();
for (File f : files) {
imageUris.add(Uri.fromFile(f));
}
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
try {
((BaseActivity) context).startActivityForResult(intent, 0);
} catch (ActivityNotFoundException exception) {
ToastUtil.showToast(context, "没安装微信。");
} catch (Exception e) {
ToastUtil.showToast(context, "异常");
}
}
相关文章推荐
- android 自带 文件大小转换.
- Android 使用SWIG生成Jni代码
- iOS设计之--OC学习总结之延展类目协议
- Unity3D研究院之手游开发中所有特殊的文件夹(assetbundle与Application.persistentDataPath)
- iOS开发之runtime详解
- 获取Cocos Studio 2.X生成资源的子孙节点的方法
- AndroidManifest.xml文件详解
- Android Property Animator (属性动画)第二篇
- Android消息处理机制Message,Looper,Handler
- Android 开源库实践
- angularjs 中 filter 过滤 orderBy排序 手机端自适应js
- iOS didReceiveMemoryWarning 内存警告 调试详解
- 【iOS】self与block的使用规范
- app_process 自定义类似am pm命令
- 类似微信图片选择器-MultiImageSelector
- 微信公众号从头开发(接入与消息)
- HBase Error: connection object not serializable
- app crash
- Android事件分发机制详解
- ios开发打电话,发短信,打开网址