[英]Photo taken from my app, saved in the right folder but can't see in the gallery
My photo is saved when i take it but i can't see it in the gallery! 拍摄时我的照片已保存,但在图库中看不到! I see it with a file manager in the right folder but not in the gallery. 我在正确的文件夹中看到了文件管理器,但在图库中却没有看到它。
Intent intent = new Intent();
// Picture from camera
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
Date date = new Date();
DateFormat df = new SimpleDateFormat("-mm-ss");
String newPicFile = "Photo"+ df.format(date) + ".jpg";
String outPath = Environment.getExternalStorageDirectory() + "/DCIM/" + newPicFile;
File outFile = new File(outPath);
mCameraFileName = outFile.toString();
Uri outuri = Uri.fromFile(outFile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outuri);
startActivityForResult(intent, CAPTURE_IMAGE );
I tried everything but nothing works fine! 我尝试了一切,但没有任何效果!
Check that the gallery is refreshed; 检查图库是否已刷新; it doesn't refresh often. 它不经常刷新。 You can call a request to refresh using something like this: 您可以使用以下方法调用刷新请求:
((BaseAdapter) yourGalleryView.getAdapter()).notifyDataSetChanged() [[BaseAdapter)yourGalleryView.getAdapter())。notifyDataSetChanged()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.