html52.com
我爱小程序-开发者交流社区

微信7.0.20, android11,是不支持imageData分享图片了吗

框架类型 问题类型 操作系统 操作系统版本 手机型号 微信版本
小程序 Bug Android android11 小米 redmik30 pro 7.0.20

https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Share_and_Favorites/Android.html

图片分享使用Bitmap分享也提示需要使用FileProvider,是android11,微信7.0.12后都只能使用setImagePath方法吗

private static boolean sharePicture(String filePath,
                                        Bitmap bmp,
                                        int scene,
                                        String appId) {
        WXImageObject imageObject = new WXImageObject(bmp);
//        imageObject.setImagePath(filePath);

        Bitmap thumbBmp; // thumb is always created within this method, so recycle is required
        if (bmp.getWidth() == THUMB_SIZE && bmp.getHeight() == THUMB_SIZE) {
            thumbBmp = bmp;
        } else {
            thumbBmp = Bitmap.createScaledBitmap(bmp, THUMB_SIZE, THUMB_SIZE, true);
            bmp.recycle();
        }
        return share(imageObject, null, thumbBmp, null, scene, appId);
    }


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付