title: connection pool shutdown android
body: <p>I have a class for Httpclient. The same instance is used throughout the application. So if the client == null it should create one else it will return the existing instance. Everything works until i try to release the resource on exit by doing: client.getConnectionManager().shutdown();....after this i am not able to login again. It gives Sysem error saying : connection pool shutdown. Heres the class:</p>
  
  <pre><code>public class HttpClientFactory {
      private static DefaultHttpClient client;        
      public synchronized static DefaultHttpClient getThreadSafeClient() {
      if (client != null)
          return client;
  
      client = new DefaultHttpClient();
      SchemeRegistry schemeRegistry = new SchemeRegistry(); 
      schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
      schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));  
      HttpParams params = new BasicHttpParams();  
      SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry);  
      client = new DefaultHttpClient(mgr, params);
  
      return client;
  }
  }
  </code></pre>
  
  <p>After this i simply run client.getConnectionManager().shutdown(); onBackPressed(),  can somebody please help me</p>