Your problem is that the action will want to rotate depending on the position of the device or keyboard (depending on which device it is). If you want the activity to ignore the rotation, add android:screenOrientation="portrait"or android:screenOrientation="landscape"to your manifest for this action. You can also add android:configChanges="keyboardHidden|orientation"to this activity, so Android is not worried about killing and re-creating activity when the user changes orientation.
See here and here for sample projects related to this.
source
share