Android Persist TextView Text on Screen Rotation

June 17, 2018

EditText's text can survive screen rotation by default. For TextView to persist text on configuration change (screen rotation), set freezesText=true


If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. By default this is disabled; it can be useful when the contents of a text view is not stored in a persistent place such as a content provider. For EditText it is always enabled, regardless of the value of the attribute.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.