android的webview为js提供localstorage后怎样把缓存文件取出来
1个回答
展开全部
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);
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);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询