android 中 webview 怎么用 localStorage? 我在 android里面 使用html5的 localStorage 为什么存不进去也读不出来呀? 网上搜了好多都没效果

解决方案:

mWebView.getSettings().setDomStorageEnabled(true);   
mWebView.getSettings().setAppCacheMaxSize(1024*1024*8);  
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();  
mWebView.getSettings().setAppCachePath(appCachePath);  
mWebView.getSettings().setAllowFileAccess(true); 
mWebView.getSettings().setAppCacheEnabled(true); 

https://www.jb51.net/article/67044.htm

posted @ 2018-09-19 15:55  AlanTao  阅读(258)  评论(0编辑  收藏  举报