I am trying to send an image taken from Camera , I am using the following code
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(i, REQ_CODE_PHOTO_TAKE);
inside onActivityResult i wrote this code
Bitmap photo = (Bitmap) data.getExtras().get("data"); mainImage.setImageBitmap(photo);
Update
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
This code works fine on almost all devices, but I ran into a problem in the LG Lucid VS840 , where the default camera mode is landscape. After capturing the image, if I press the ok button, the image will remain visible for seconds and then disappear. At that time, I literally see a change in camera mode.
I wrote android:configChanges="orientation|keyboardHidden" in AndroidManifest.xml , but this did not work.
You can find the video link here: Link
I tested this code on the following devices where it worked.
- Sony xperia U
- Samsung Galaxy Nexus
- Motorola droid RAZR
- Samsung ACE
source share