As of recently (probably as a new SDK feature), when I try to pull text from a Textview
, I first get the method getFreezesText()
, instead of
android:freezesText="true"
will freeze your last completed text. But what is the last completed Text?
Suppose you are showing a textView
which is changing after every 2 seconds everything is okay until you rotate the screen and if you rotate the screen the text inside textView will not be visible, here freezesText
comes, it will freeze the last showed text (last completed Text).
If you want to force your TextView
(or EditText
etc. for that matter) to save its state you must add freezesText attribute:
<TextView
...
android:freezesText="true" />
From documentation on freezesText :
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
The attribute and method have existed since API 1, so I'll say you just noticed it.