Code example for BasicHttpContext

Methods: setAttribute

0
	private static BasicCookieStore mCookieStore = new BasicCookieStore();
 
	private HttpRequestHandler() { 
		if (client == null) {
			client = AndroidHttpClient.newInstance("Android");
			mLocalContext.setAttribute(ClientContext.COOKIE_STORE, mCookieStore);
			client.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
		} 
	} 
	 
	public static HttpRequestHandler getInstance() { 
		if (_hrh == null) {
			_hrh = new HttpRequestHandler();
		}  
		return _hrh;
	} 
	 
	public void finalize() { 
		// don't leak; 
		client.close();
	}