目前我有一个程序可以拍照并将它们保存为 SD 卡顶层的 jpg,但它没有出现在图库中。我必须做些什么才能实现它吗?
最佳答案
您需要 call the MediaScanner以便它知道您的文件存在:
File file; // = your file
String mimetype; // = your file's mimetype. MimeTypeMap may be useful.
MediaScanner.scanFile(getApplicationContext(), new String[]{file.getPath()}, new String[]{mimetype}, null);
关于Android 图片保存到 SD 卡不显示在图库中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6673809/