Pyae Phyoe Shein
Pyae Phyoe Shein

Reputation: 13787

android webview cache image

Here is my coding

webView1.loadUrl("http://www.ppshein.com.mm/testimage.jpg");

What I want is I want to cache this image when image is completely loaded in webview. That's why it can be able to display when device is offline.

Upvotes: 2

Views: 3530

Answers (2)

pablopatarca
pablopatarca

Reputation: 634

Add the next lines:

mWebView.getSettings().setAppCacheEnabled(true); mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

Upvotes: 2

user2288926
user2288926

Reputation: 11

you can open cacheMode.when your img downloaded,it will be in the/data/data/your packagename/cache the directories below

Upvotes: 0

Related Questions