richeditor-android icon indicating copy to clipboard operation
richeditor-android copied to clipboard

How to set cache ?

Open goadsth opened this issue 4 years ago • 2 comments

I used editor.getSettings() to set web's cache,but it didn't work,it load pictures slowly everytime I reopened the same activity.

goadsth avatar Mar 12 '20 10:03 goadsth

like this: private void addCookies(String url) { CookieManager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeSessionCookies(null); PersistentCookieStore cookieStore = new PersistentCookieStore(UIUtils.getContext()); for (Cookie cookie : cookieStore.getCookies()) { //add cookie cookieManager.setCookie(url, String.format("%s=%s", cookie.name(), cookie.value())); } cookieManager.flush(); } }

yeaper avatar Apr 02 '20 06:04 yeaper

thanks!

---Original--- From: "yeaper_yeo"<[email protected]> Date: Thu, Apr 2, 2020 14:28 PM To: "wasabeef/richeditor-android"<[email protected]>; Cc: "goadsth"<[email protected]>;"Author"<[email protected]>; Subject: Re: [wasabeef/richeditor-android] How to set cache ? (#222)

like this: private void addCookies(String url) { CookieManager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeSessionCookies(null); PersistentCookieStore cookieStore = new PersistentCookieStore(UIUtils.getContext()); for (Cookie cookie : cookieStore.getCookies()) { //add cookie cookieManager.setCookie(url, String.format("%s=%s", cookie.name(), cookie.value())); } cookieManager.flush(); } }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

goadsth avatar Apr 02 '20 07:04 goadsth