I have implemented the shouldInterceptRequest method on WebViewClient. In there I am using HttpURLConnection to load the resources myself. To do this I have to set the cookies on the url connection. This is all working perfectly fine on android 4.3 and below however on kitkat it freezes because there is a deadlock on the CookieManager.getCookie(url). The issue is documented here https://code.google.com/p/android/issues/detail?id=65786

Anyways I could read the cookie on a thread or something prior to the call to shouldInterceptRequest but I need the url that is passed on shouldInterceptRequest so I just don't know what to do. Is it possible to implement cookie saving in some other way for the WebView?

Thanks.

有帮助吗?

解决方案

See my reply on the bug: https://code.google.com/p/android/issues/detail?id=65786#c8. I'm curious to see if that helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top