網上搜了好多都沒效果html
1
2
3
4
5
6
7
8
9
|
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
);
|
解決方案:html5
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setAppCacheMaxSize(1024*1024*8);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
mWebView.getSettings().setAppCachePath(appCachePath);
mWebView.getSettings().setAllowFileAccess(true); java
mWebView.getSettings().setAppCacheEnabled(true); android
這個測試了是能夠的app
轉自:http://www.oschina.net/question/111965_108361?sort=time測試