4

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
Ronak Mehta
  • 5,971
  • 5
  • 42
  • 69

1 Answers1

0

What's your target SDK version? You need to supply screenSize as well if that's above 13.

Ref: http://developer.android.com/guide/topics/manifest/activity-element.html#config

See the note for orientation.

ozbek
  • 20,955
  • 5
  • 61
  • 84