androidandroid-camera-intenthtc-android

HTC Wildfire S, intent of camera capture has a duplicate copy in Gallery in addition to the specified output in ContentProvider


For security reason, I do not want the photo saved in the sdcard. So after searching, I find a way to save the photo in the intenral storage. The code snippet is as below:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
photo = new File(this.getFilesDir(), BCConstants.CAMERA_IMAGE_NAME);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
        ContentProviderForCameraCapture.CONTENT_URI);

And it works for several devices, such as Nexus 4.

But for HTC Wildfire S, I find a duplicate copy in Gallery!

Why? I do not need a twin!


Solution

  • I find the issue that many programmers met: "Deleting a gallery image after camera intent photo taken"

    Originally I just used the EXTRA_OUTPUT, but I soon discovered the following: - Some devices use it completely and skip the gallery. - Some devices ignore it completely and ONLY use the gallery. - Some devices really suck and save a full sized image to the gallery, and save a thumbnail only to the location I wanted. (HTC you know who you are...)

    Hmm, you know who you are ... :)

    Or see "Android Camera intent creating two files"