Reputation: 5904
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!
Upvotes: 0
Views: 102
Reputation: 98
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()
Upvotes: 1