views:

183

answers:

0

Hello -

I am using an intent to capture a picture:

      Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
      i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment.getExternalStorageDirectory(), "test.jpg")));
      startActivityForResult(i, 2); 

And then once taken I do the following:

        sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"  + Environment.getExternalStorageDirectory())));
        launchGallery();

While the above seems to work the first time without issue, whenever I run through a second time (so test.jpg already exists) the image actually saves correctly to /sdcard/ but I am finding that the thumbnail does not update and when the gallery loads it shows the previous test.jpg image!

I was under the impression that sendBroadcast should update the thumbnails, but it doesn't appear to be.. Is there some other way to go about this and ensure when I call my launchGallery(); method the most recent image I just took appears?

Thanks!