0

I am using webview and saving all the pages to cache.

    webContainer.getSettings().setAppCacheEnabled( true );
    // loading offline
    if ( !isNetworkAvailable() )
    { 
         webContainer.getSettings().setCacheMode( WebSettings.LOAD_CACHE_ELSE_NETWORK );
    } 

There is a case where page is not visited previously and network is not available, in that case it shows page not found error. I want to replace it with error.html page. Is there any way to check if the specific page is cached or not.

Archana
  • 101
  • 2
  • 9
  • No you can't put up a error.html file, instead in your app try to detect internet connectivity and if it is not present display an activity. This link might help http://stackoverflow.com/questions/4238921/detect-whether-there-is-an-internet-connection-available-on-android – Kunal Yadav Aug 24 '16 at 09:39
  • We can defiantly add and show error.html file but I want to find if the specific page is cached or not. If the page is not cached then I want to show error.html else the cached page. – Archana Aug 24 '16 at 09:48
  • ohh, then rephrase your question add some code and ask, these guys would only help if you show them the code – Kunal Yadav Aug 24 '16 at 09:50

0 Answers0