app 多图片分享至微信朋友圈

 由于微信分享的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 imageUris = new ArrayList();
        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开发)