I am building an application for Android 2.2 which is based on a photo library. There is an option to take picture from camera and use it in the application. I am expecting:
-
To enable the camera from the application.
-
To take the picture.
-
To automatically close the camera and show the captured picture inside the application
Unfortunately, I am not able to get the captured image to the application. Once photo is taken, camera is not closing automatically or returning to the app. Now I have to click the back button to go to the app and select the picture manually select from SD card. Camera is opening through intent and I am using the following class.
http://developer.android.com/reference/android/hardware/Camera.html
You need to do two things. Start the Camera app and tell it where to store the picture that it takes:
When the user closes the Camera app, you app and Activity will be resumed. So you must override onActivityResult to get the result:
If you don’t provide the place to save, you can alternatively retrieve it using either intent.getData or intent.getParcelableExtra using Intent.EXTRA_STREAM.