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

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

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实现微信多图分享到朋友圈)