My question is pretty similar to Cookies & Webview - CookieSyncManager in Android!, but I really need to get the SystemClock.sleep()
time adjusted or another way to get setCookie
react immediately. Didn't work with 500ms, but worked with 5000ms, so it's not very reliable. Any way to loop sleep in onPageStarted
where I call sync
for CookieManager
after setCookie
?
My environment gets Cookie value from another server, so there is no session cookie here.
Thanks.
UPDATE:
Looks like Cookie handling is not working at all. I have following web flow:
- Set Cookie and load url
- Server handles that Cookie is okay, so it adds another cookie to indicate we have a session
- WebView still loads page showing no session
- I start my
WebView
again, and nowgetCookie
shows the session Cookie and loads page properly