简体   繁体   中英

not able to release connection while using Apache HTTPClient

I am using HTTPCLient API's in my android app. After having made a getRequest , I wanted to release the connection . As per the javadoc the available method is request.releaseConnection(). When i used that method in normal java project, it worked. But when I use it in my android project, Eclipse annoys me with red squiggly line and doesn't list that method in suggestion list too.

I referred to this question

Problems with HttpMethod.releaseConnection() and EntityUtils.consume(entity)

Where one of the answer said that android comes with prepackages of httpclient libs. So just to check I removed my external HTTPClient libraries and eclipse annoys again.

It shows error because android doesn't support this method. The best way to know would be press . and Ctrl+space then it will show all the methods available from that you can see that releaseConnection() is missing. So these methods will give a compilation error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM