Android: Automatic switching to/from landscape/portrait mode

Q: We are working on Android version of the SDK. We are trying to display a PDF and it displays fine in portrait mode but when I switch to landscape mode, the orientation of the PDF does not change. Pls let me know how to accomplish this.

A: When rotating the device, Android restarts the activity by default. To maintain the current activity, it is necessary to add android:configChanges=“keyboardHidden|orientation” to the Activity’s manifest node in AndroidManifest.xml, and then override the method onConfigurationChanged(). Yoy may also want to take a look here: stackoverflow /questions/6457659/