5

I have a webview that loads an external web page. I want to implement a custom caching mechanism so there will be no need to download resources like css, js and images again. I have already tried those two methods:

  • override the shouldInterceptRequest method of the WebViewClient

This way I am able to provide my local resource to the webview. There is no way to get the resource that the webview downloads. The real downloading happens after the method has ended. According to the documentation the resource is downloaded only if this method returns null.

  • override the onLoadResource method of the WebViewClient

This way I can only get the URL of the loaded resource and nothing more...

Thanks for the help!

Kiril Aleksandrov
  • 2,601
  • 20
  • 27

0 Answers0