Question Detail

How to Handle Orientation Changes on Android?

6 years ago Views 1292 Visit Post Reply

In my App when I rotate Mobile Portrait to Landscape my TextView's value get disappear( TextView get Empty). because My Activity starts again while Screen Rotation. I want to handle this issue. Please Suggest me how can I save state of activity when orientation changes?

Thread Reply

Hemant Sharma

- 6 years ago

 its work through

<activity name= ".YourActivity" android:configChanges="orientation|screenSize"/>

in Manifest file.
the framework will take care of none refresh value and No restart Activity It will retain the state of the screen or layout if orientation is changed.