setFreezesText/android:freezesText

setFreezesText

added in API Level 1
Related XML Attribute: android:freezesText

setFreezesText (boolean freezesText)
Control whether this text view saves its entire text contents when freezing to an icicle, in addition to dynamic state such as cursor position. By default this is false, not saving the text. Set to true if the text in the text view is not being saved somewhere else in persistent storage (such as in a content provider) so that if the view is later thawed the user will not lose their data.

1. Find a TextView using ID
       
2.Add the code below to the onCreate method.

    myTextView.setFreezesText(true);



3. To turn off you'd use:
    myTextView.setFreezesText(false);

4. Compile and run!

Related Articles: