I using CookieManger with okHttp and i don't know why its saying:
Cannot resolve setCookieMethod. I googled its a valid method and the CookieManger and OkHttp is Imported in the project.
OkHttpClient client = new OkHttpClient();
CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
client.setCookieHandler(cookieManager);
OkHttp has a new
CookieJar
interface!where
cookieJar
is an instance ofokhttp3.CookieJar
.If you really like
java.net.CookieManager
, you can use Jesse'sJavaNetCookieJar
: https://github.com/square/okhttp/blob/master/okhttp-urlconnection/src/main/java/okhttp3/JavaNetCookieJar.java