我已在shouldInterceptRequest
上实施了WebViewClient
方法。在那里我使用HttpURLConnection自己加载资源。为此,我必须在URL连接上设置cookie。这对于android 4.3及以下版本都运行良好,但是在kitkat上它会冻结,因为CookieManager.getCookie(url)
上存在死锁。此问题记录在此处https://code.google.com/p/android/issues/detail?id=65786
无论如何,我可以在调用shouldInterceptRequest
之前读取某个帖子上的cookie,但我需要传递shouldInterceptRequest
的网址,所以我不知道该怎么做。是否可以以其他方式为WebView实现cookie保存?
感谢。
答案 0 :(得分:0)
请参阅我对错误的回复:https://code.google.com/p/android/issues/detail?id=65786#c8。我很想知道这是否有帮助。