简体   繁体   English

图片未从图库中加载

[英]Images not being loaded from gallery

 Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                        getActivity().startActivityForResult(i, 100);
 //on activity result now Uri selectedImageURI = data.getData();
Picasso.with(rootView.getContext()).load(selectedImageURI.toString()).into(image);

Okey simply, I call to open the gallery.Once opened i need to retrive image, its working in case of some pictures and in case of others not. 简而言之,我打电话给Okey,要求打开图片库。打开图片后,我需要检索图片,某些图片在某些情况下会起作用,而其他图片则不会。 I noticed those others are images deleted from my phone? 我注意到其他人是否从手机中删除了图像? why are they showing? 他们为什么要显示?

ITS GIVing me uri content://com.google.android.apps.photos.contentprovider/-1/1 ...its the -1 ones not working always. 它给了我uri content://com.google.android.apps.photos.contentprovider/-1/1 ...它的-1不能一直工作。 I do not get any crash either. 我也没有崩溃。

I noticed those others are images deleted from my phone? 我注意到其他人是否从手机中删除了图像? why are they showing? 他们为什么要显示?

Because MediaStore does not know that the images were deleted, apparently. 因为MediaStore显然不知道图像已删除。 Whatever deleted them did not tell the MediaStore to update its index. 删除它们的任何内容都不会告诉MediaStore更新其索引。 Eventually, MediaStore will find this out and will filter them from its index, so the user cannot choose them via ACTION_PICK . 最终, MediaStore会发现并从索引中过滤掉它们,因此用户无法通过ACTION_PICK选择它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM