图像保存到SD卡,不会出现在Android的画廊应用程序出现在、画廊、应用程序、图像

2023-09-11 11:56:56 作者:残↙爱

我保存图像的SD卡,并直到我决绝的SD卡就不会出现在Gallery应用程序,然后返回。

I save an image to the sdcard and it doesn't appear in the Gallery application until I pull off the sdcard and return it back.

你有任何想法,为什么会这样呢?

Do you have any idea why is it so?

好像Gallery应用程序有一些高速缓存未更新的文件保存...

Seems like the Gallery application has some cache that isn't updated on file save...

其实,我也想开画廊中的应用刚刚保存的图像,并有与 this是关于这个问题,我的问题。

Actually, I also want to open the just-saved image in Gallery application and have no success with that this is my question about this issue.

推荐答案

系统扫描时,它被安装到发现新的图像(或其他)文件的SD卡。如果你使用程序添加一个文件,那么你可以使用这个类:

The system scans the SD card when it is mounted to find any new image (and other) files. If you are programmatically adding a file, then you can use this class:

http://developer.android.com/reference/android/media/MediaScannerConnection.html

 
精彩推荐
图片推荐