0

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!

Atlas91
  • 5,754
  • 17
  • 69
  • 141
  • possible duplicate of [How to register an image so that it is immediately viewable from Gallery application?](http://stackoverflow.com/questions/9360091/how-to-register-an-image-so-that-it-is-immediately-viewable-from-gallery-applica) – CommonsWare Mar 25 '14 at 23:55

1 Answers1

1

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()

John O.
  • 98
  • 7