How to retain text data when orientation changes

I want to retain the text data in the webview (ie the data entered in the text box of the form in the url loaded) across the orientation changes. I used, onSaveInstanceState() * restoreState(savedInstanceState) it restores previous state but not the values.

I resorted to use webview with Fragments , still no luck in retaining the data. Also when using Fragments the app crashes when orientation changes.

I cannot use android:configChanges="keyboardHidden|orientation as I need keyboard when the orientation changes.

Can anyone provide a solution to this ? Thanks in advance.


Can't you use android:configChanges="orientation|screenSize" without the keyboardHidden ?

Edit : You may also want to use screenSize when targeting API 13 or higher.

链接地址: http://www.djcxy.com/p/46442.html

上一篇: 链接使用时查找失败

下一篇: 如何在方向更改时保留文本数据