Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Chweikewen opened this issue Sep 14, 2022 · 0 comments

Comments

@Chweikewen
Copy link

Chweikewen commented Sep 14, 2022

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant