Rahul Nagane
Rahul Nagane

Reputation: 131

Webview loads again and again in listview

I am using webview as an list element but it reloads as list is scrolling, how to avoid reloading of webview. can we cache webview data.

Thanks in advance.

Upvotes: 0

Views: 178

Answers (1)

Harikumar S.
Harikumar S.

Reputation: 56

we can cache the web view content by using any of the following codes.

webview.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);

webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

Upvotes: 1

Related Questions