Httpclient를 한번 생성하고 다른 class에서도 가져다 쓰면 쿠키가 계속 유지된다.
Cookie_class.getInstance().setclient(httpClient);
httpClient = Cookie_class.getInstance().getclient();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public class Cookie_class { private static Cookie_St instance = null; private HttpClient httpclient; public HttpClient getclient(){ return httpclient; } public void setclient(HttpClient a){ httpclient = a; } public static synchronized Cookie_St getInstance(){ if(null == instance){ instance = new Cookie_St(); } return instance; } } | cs |
'Android' 카테고리의 다른 글
Kakao link를 사용해보자 -세팅 (0) | 2015.11.12 |
---|