安卓webview设置缓存让localStorage生效

2019-10-30  本文已影响0人  手指乐
 //使用缓存,否则localstorage等无法使用
        settings.setDomStorageEnabled(true);
        settings.setAppCacheMaxSize(1024*1024*8);
        String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
        settings.setAppCachePath(appCachePath);
        settings.setAllowFileAccess(true);
        settings.setAppCacheEnabled(true);
上一篇 下一篇

猜你喜欢

热点阅读