0

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!!

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Rino
  • 1,215
  • 1
  • 16
  • 28

1 Answers1

1

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"/>
Ratilal Chopda
  • 4,162
  • 4
  • 18
  • 31
ADM
  • 20,406
  • 11
  • 52
  • 83
  • Have a look into [This thread](https://stackoverflow.com/questions/16014930/android-activity-getting-destroyed-after-calling-camera-intent) if you have not already . – ADM Dec 12 '17 at 10:59
  • Did any solution workout ? I had the same issue with samsung s4 recently and that worked out for me . – ADM Dec 12 '17 at 12:20
  • 1
    I should agree that the chances of occurring this issue has been reduced!! But sometimes it still occurs. – Rino Dec 13 '17 at 04:33
  • Yeah thats why no accepted answer in above thread . At that time i have tested in lots of devices but this issue occurs only in S4(None of other devices even old ones which was launched before S4). It is low memory cache issue i think. Anyway keep digging and if you found any exact solution post here .Thx – ADM Dec 13 '17 at 04:49