美文网首页
Android实现微信多图分享到朋友圈

Android实现微信多图分享到朋友圈

作者: 馒头Show | 来源:发表于2017-05-22 16:19 被阅读0次

//调用系统方法,支持微信多图分享

Intent weChatIntent =newIntent();

weChatIntent.setComponent(newComponentName("com.tencent.mm","com.tencent.mm.ui.tools.ShareToTimeLineUI"));

ArrayList imageList =newArrayList();

FrescoUtils imageUtil =newFrescoUtils();

for(String path :picPaths){//picPaths存的是本地图片路径

File file =newFile(path);

if(file.exists()){

imageList.add( Uri.parse("file://"+ file));//注意路径前面要加上file://

}

}

if(imageList.size() ==0)return;

weChatIntent.setAction(Intent.ACTION_SEND_MULTIPLE);

weChatIntent.setType("image/*");

weChatIntent.putExtra(Intent.EXTRA_STREAM, imageList);

weChatIntent.putExtra("Kdescription","hahahahhahahahah");//分享描述

startActivity(weChatIntent);

调试中遇到的问题

1,图片路径不支持网络图片URL,只支持本地的图片

2,图片List集合中图片路径,前面需加上file

3,Kdescription,这个字段一定要设置内容

备注:如果有参数上不懂的可以问我,谢谢

相关文章

网友评论

      本文标题:Android实现微信多图分享到朋友圈

      本文链接:https://www.haomeiwen.com/subject/prfixxtx.html