保存到 sdcard 的图像不会出现在 Android 的图库应用中 [英] Image, saved to sdcard, doesn't appear in Android's Gallery app

查看:26
本文介绍了保存到 sdcard 的图像不会出现在 Android 的图库应用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将图像保存到 sdcard 中,但在我取出 sdcard 并将其返回之前,它不会出现在 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 卡时扫描 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

这篇关于保存到 sdcard 的图像不会出现在 Android 的图库应用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆