在我的应用程序我有的TextView
和 EditView中
。两人都在它的数据。当屏幕方向改变了数据的 EditView中
仍然存在,但的TextView
数据被清除。
In my app I have Textview
and EditView
. Both have data in it. When the screen orientation changes the data in the Editview
remains, but Textview
data is cleared.
我很困惑......
I am confused ...
可以有一个人帮助我找到一种方法来保留数据的TextView
吗?
Can some one help me out to find a way to retain data in TextView
too?
如果要强制你的的TextView
保存其状态必须添加freezesText属性:
If you want to force your TextView
to save its state you must add freezesText
attribute:
<TextView
...
android:freezesText="true" />
从技术文档的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
上一篇:Android的谷歌工作室罐子引起GC开销超限错误罐子、开销、错误、工作室
下一篇:java.lang.IllegalStateException:以后的onSaveInstanceState无法执行此操作操作、lang、java、onSaveInstanceState