문제

I am going to use cookies in my application so I don`t have to re-login for each requst I make to the server. Further on I have been looking on examples, and it seems that this is done in each of them:

CookieStore mCookieStore  = new BasicCookieStore(); 

However, when I try to do this I only get the error:

Cannot convert from BasicCookieStore to CookieStore

Thanks for any help!

도움이 되었습니까?

해결책

I guess you import the wrong java class.

The correct ones:

import org.apache.http.client.CookieStore;

not

import java.net.CookieStore;

BasicCookieStore implements CookieStore. You should be able to convert from BasicCookieStore to CookieStore.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top