美文网首页
android WebView离线缓存

android WebView离线缓存

作者: 笑笑_520 | 来源:发表于2019-01-02 11:11 被阅读0次

if (NetworkUtil.isConnected(mContext))

    mWebView.getSettings().setCacheMode(LOAD_DEFAULT);

else

    mWebView.getSettings().setCacheMode(LOAD_CACHE_ELSE_NETWORK);

webSettings.setDatabaseEnabled(true);

webSettings.setDomStorageEnabled(true);

String cacheDirPath = g

etFilesDir().getAbsolutePath() +"/webCache";

mWebView.getSettings().setDatabasePath(cacheDirPath);

相关文章

网友评论

      本文标题:android WebView离线缓存

      本文链接:https://www.haomeiwen.com/subject/csvalqtx.html