简体   繁体   中英

Android Webview - 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM