保存网页视图页面的状态 [英] Webview saving state of page

查看:148
本文介绍了保存网页视图页面的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题,我使用的是web视图。我试图使用web视图允许用户填写一张登记表。当用户完成表单在一个会议,但如果用户锁定自己的手机也能正常工作,web视图活性被破坏。

I have a small problem with a webview I'm using. I'm trying to use the webview to allow the user to fill out a registration form. This works fine when the user completes the form in one session but should the user lock their phone, the webview activity is destroyed.

我在内存中的两个活动,其中之一是相当占用大量内存。我相信我遇到的问题是,由于这种其他活动需要比的WebView更多的内存,web视图被破坏。

I have two activities in memory, one of which is quite memory intensive. The problem I believe I'm having is that because this other activity requires more memory than the webview, the webview is destroyed.

我很好这在一定程度上,但我真的希望能够保存网页的当前状态,以便用户不必再次提交他们的所有细节。有反正我可以做到这一点。

I'm fine with this to a degree, but I would really like to be able to save the current state of the web page so the user doesn't have to submit all of their details again. Is there anyway I can do this.

感谢

推荐答案

试试吧: -
您可以使用的WebView方法saveState和()/ restoreState(),并把它保存到活动OnRestore中捆绑,并在onCreate方法使用保存的值,如果previous活动将被销毁。
你可以使用这里描述的(但仅用于配置改变)类似的方法:
<一href=\"http://www.devahead.com/blog/2012/01/$p$pserving-the-state-of-an-android-webview-on-screen-orientation-change/\" rel=\"nofollow\">http://www.devahead.com/blog/2012/01/$p$pserving-the-state-of-an-android-webview-on-screen-orientation-change/

这篇关于保存网页视图页面的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆