I'm trying to post an image captured from Camera
, i'm using 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);
Updated
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
This code works fine on almost all devices but i am facing problem in LG Lucid VS840 where by default camera mode is landscape. After capturing image, if i press ok button, image remains visible for seconds and then disappears. At that time, I literally can see camera mode changing.
I had written android:configChanges="orientation|keyboardHidden"
in AndroidManifest.xml
but it did not work.
You can find video link here : Link
I have tested this code in following devices where it worked .
- Sony xperia U
- Samsung Galaxy Nexus
- Motorola droid RAZR
- Samsung ACE