Android微信分享到朋友圈-通过微信SDK发布

[java]
WXImageObject imgObj = new WXImageObject();
imgObj.setImagePath(path);

WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = imgObj;

Bitmap bmp = BitmapFactory.decodeFile(path);
Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp, THUMB_SIZE, THUMB_SIZE, true);
bmp.recycle();
msg.thumbData = Util.bmpToByteArray(thumbBmp, true);

SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("img");
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneTimeline ;
api.sendReq(req);
[/java]

以上代码可以分享一张图片到微信朋友圈

那么能否一次发布多张图片呢??
现在SDK版本是不能处理多个图片。
通过查看源代码,发现有下面内容:

[java]
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_TEXT = 1;
public static final int TYPE_IMAGE = 2;
public static final int TYPE_MUSIC = 3;
public static final int TYPE_VIDEO = 4;
public static final int TYPE_URL = 5;
public static final int TYPE_FILE = 6;
public static final int TYPE_APPDATA = 7;
public static final int TYPE_EMOJI = 8;
SDK 通过Bundle来传递数据,用<key,value>记录每种数据类型,并且都是单条的记录,如图片数据 WXImageObject :

paramBundle.putByteArray("_wximageobject_imageData", this.imageData);
paramBundle.putString("_wximageobject_imagePath", this.imagePath);
paramBundle.putString("_wximageobject_imageUrl", this.imageUrl);
[/java]

只有单一的 imageData !!!所以不能支持多个图片!

通过系统调用分享到朋友圈,可以参考.