Android的 - 让web视图DomStorage持久性应用程序关闭后,持久性、视图、应用程序、Android

由网友(戀ㄋ精灵╄)分享简介:我现在面临一个巨大的问题,开发一个Android应用程序,它使用web视图来显示DATAS。我使用的web视图的网站上使用HTML 5中的localStorage API。I'm facing a huge problem developing an Android app which use a Webview t...

我现在面临一个巨大的问题,开发一个Android应用程序,它使用web视图来显示DATAS。我使用的web视图的网站上使用HTML 5中的localStorage API。

I'm facing a huge problem developing an Android app which use a Webview to display datas. The website i'm using in the webview use localStorage API of HTML 5.

要启用此功能,我设置web视图像这样设置:

To enable this feature i've set the webview setting like this :

webview.getSettings().setDomStorageEnabled(true);
webview.getSettings().setJavaScriptEnabled(true);

所以localStorage的API的工作,但是当我关闭该应用程序(和杀死进程),localStorage的是完全地抹去,当我重新加载它,我的所有的数据都是丢失。

So the localStorage API works but when I close the app (and kill the process), localStorage is completly erased and when I reload it, all my datas are lost.

我的问题很简单:如何让一个web视图的DomStorage持续性,即使我们关闭应用程序

My question is simple : How to make DomStorage of a Webview persistant even when we close the app ?

感谢你为未来的答案。

推荐答案

你设置DatabasePath? Android不知道在哪里保存DOMDatabase在默认情况下,如果不设置调用

Did you set the DatabasePath? Android doesn't know where to save the DOMDatabase by default, if you don't set it calling

webview.getSettings().setDatabasePath()
阅读全文

相关推荐

最新文章