Search code examples
androidandroid-contentproviderandroid-cameraandroid-camera-intent

samsung vibrant camera activity takes 2 photos


Uri imageFileUri = 
    context.getContentResolver().insert(
        Media.EXTERNAL_CONTENT_URI, new ContentValues()
    );
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri); 
context.startActivityForResult(i, ImportActivity.CAMERA_REQUEST);

On my samsung Galaxy S (aka Vibrant) When I take a photo using the above method I get two photos in my gallery when I hit save. One is in a default album for photos called "Photos" and the second one being created because of my uri is called "Camera".

I would prefer photos taken with the above code snippet to not be saved to the default "Photos" and have the album of the ones we save be the name of my app (I.E. "Acme Mobile"). How do I achieve this?


Solution

  • The camera app is developed by the device manufacturer, there is no standard camera app. Whether the picture taken is saved in the gallery as well as your uri path is dependent on the device app implementation. You have no control over it. The best you can do is , after you take the picture you can delete the file in gallery folder and only save your file. Just be careful while deleting files from gallery.