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

How to add gallery button to Camera open with intent?


In my app users are able to make a photo with camera. And I start it using intents:

Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

Now when open camera lacks the gallery button which would allow user to pick one of existing images from his SD card. Is it possible to show this button?


Solution

  • You can't really change the things camera intent has to offer, and if you do find a device where the camera app would let you access the gallery I wouldn't depend on it.

    I would recommend that whenever your user taps on the button or whatever launches the Camera Intent, launch a dialog that asks you the user to choose, "New Photo" or "Existing Photo". If they choose existing, launch the gallery intent.

    Here is a really good tutorial for the gallery intent.

    http://www.helloandroid.com/tutorials/gallery-intent-tutorial

    Good Luck!