Preventing Camera Intent from adding picture to Gallery

All your problems with Audio, Video and Images.

Preventing Camera Intent from adding picture to Gallery

Postby manianac » Sun Jun 05, 2011 9:36 pm

I use the following code to take a picture:
Code: Select all
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(path + "/" + fileName)));
    intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
    startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

Now when I use this, it does save the picture where I specify above, but it also saves a second copy to the default image folder and adds it to the gallery.

I would simply delete the second file, but it seems it would be a tad dangerous as onActivityResult's intent parameter is always null after taking said picture, so I would have to attempt deleting the most recently saved picture.

Is there any way I can prevent this behavior or correct it by getting the URI of the dupicate picture?
manianac
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jun 05, 2011 9:32 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests