Save data and change orientation

If you have small data, you can save and restore it using onSavedInstanceState and onRestoreInstanceState .. for details go through this link Saving data

But in case, you have large data then I must say, you should not allow for the orientation changes(which force your activity to recreate). You can restrict it by adding below line in manifest file :

android:configChanges="orientation|keyboardHidden" // fixes orientation

Leave a Comment