Skip to content

vivo X20Plus A 等部分机型,保存图片到相册后,选择器不显示该图片 #75

@Chweikewen

Description

@Chweikewen

vivo X20Plus A(Android 8.1.0)、Y9s(Android 9)等设备有这个问题
系统相册里面已经可以看到新保存的图片,但是选择器不显示该图片。
保存代码如下:
public static String saveBitmapBroadcast(Activity activity, Bitmap bitmap) {
String path = MediaStore.Images.Media.insertImage(activity.getContentResolver(), bitmap, "image" +
System.currentTimeMillis()+ "_" + (int) (Math.random() * 100), "description");
activity.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse(path)));
ImageSelector.clearCache(activity);//主动清缓存也无效
return path;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions