Android HttpClient memory leak?
I was looking at code for a sample Android application. Within the 开发者_如何学JAVAcode, the application creates an HttpClient, but I never see anywhere where the connection is closed. So I was wondering does this code create a memory leak? If not, can you explain why?
The link to the sample code is at:
http://developer.android.com/resources/samples/SampleSyncAdapter/src/com/example/android/samplesync/client/NetworkUtilities.htmlHttpClient relies on a ClientConnectionManager to handle opening and closing connections. It (HttpClient) is a utility class that is supposed to allow you to forget about lots of details like closing connections.
"That's not a bug. It's a feature!"
精彩评论