Roland Roland - 9 months ago 35
Android Question

Losing data when rotate screen

I have a little funny bug in my application. When the user rotates the screen I lose some of the data in my activity. Anyone that have an idea of why this happens?

Thanks in advance
Roland

Answer Source

By default, when the screen is rotated your Activity is killed and restarted. To make sure no data is lost, you need to properly save and restore your data using the lifecycle methods. See Saving Persistent State.