![](/img/trans.png)
[英]Android Webview - How to retain text data when orientation changes
[英]Android Webview using Fragments to Retain text data across orientation changes
我需要使用Fragment創建一個webview,以便當方向更改時,不會丟失webview中的數據(表單中的文本)。
像本例中的FragmentRetainInstance.Java一樣,我希望使用setRetainInstance(true)進行webview工作。
我將使用Android片段兼容性包,請通過示例幫助我實現以上目標。 提前致謝。
有一個非常相似的問題,但必須進行一些補充才能使其適用於各種版本(包括ICS)。
在主應用程序活動中,我添加了與“公平競爭者”提供的版本稍有不同的版本。
<activity
android:name=".MyMainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name" >
我曾用以下方法處理蜂窩前的工作:
<activity
....
android:configChanges="orientation|keyboardHidden"
.... >
使用片段和Honeycomb,您需要在android:configChanges上使用“ screenSize”選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.