I use HTML5 in the Android Localstorage why can't I read it?
There's been a lot of searching on the Internet.
| 123456789 |
mainWebView = (WebView)this.findViewById(R.id.mainWebView); WebSettings settings = mainWebView.getSettings(); settings.setJavaScriptEnabled(true); settings.setAllowFileAccess(true); settings.setDatabaseEnabled(true); String dir = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); settings.setDatabasePath(dir); settings.setDomStorageEnabled(true); settings.setGeolocationEnabled(true); |
Solution:
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);
This test is possible.
Transferred from: Http://www.oschina.net/question/111965_108361?sort=time
How does WebView use Localstorage in Android?