简体   繁体   中英

Is it possible to detect if Android webview's goBack() will load content from cache?

I'm having issue with Android webview's goBack() not sending custom request headers and cookies. I'm trying to fix this by reloading the whole page on goBack(), but it should be done only when goBack() is not going to load content from cache. Is there a way to programmatically detect that webview's goBack() is going to load content from cache or not. Thanks.

If the load isn't from the cache, then it will go through WebViewClient.shouldInterceptRequest . Note that in the case of goBack , the shouldOverrideUrlLoading will not be called, as it is not called for navigations started via the Java API calls.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM