框架类型 | 问题类型 | 操作系统 | 操作系统版本 | 手机型号 | 微信版本 |
---|---|---|---|---|---|
小程序 | 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);
}