Rino
Rino

Reputation: 1215

Activity rotates after taking camera through intent in S4

Does anyone face a similar issue in S4? Its working on other devices.

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, PICK_IMAGE_CAMERA);

This is the code I'm using to call the camera application, after taking the picture the activity from which it was called rotates even though I have specified the activity orientation as portrait in manifest. It lasts for only a second and comes back to the portrait mode.

Note: issue exists only in S4!!

Upvotes: 0

Views: 62

Answers (1)

SpiritCrusher
SpiritCrusher

Reputation: 21053

Update your manifest entry of Activity Add configChanges attribute.

<activity
      android:name=".YourActivity"
      android:configChanges="screenSize|keyboardHidden|orientation"
      android:label="@string/app_name"
      android:screenOrientation="portrait"
      android:theme="@style/AppTheme.NoActionBar"/>

Upvotes: 1

Related Questions