protected void onStop(){
  super.onStop();
  try {
    if (client != null) {
      client.stop();
      Log.i("Jetty","Stopped httpclient");
    }
  }
 catch (  Exception e) {
    Log.e("Jetty","Error stopping httpclient ",e);
  }
 finally {
    client=null;
    fileInProgress=null;
  }
}

protected void onStop ( ) { super . onStop ( ) ; try { if ( client != null ) { client . stop ( ) ; Log . i ( "Jetty" , "Stopped httpclient" ) ; } } catch ( Exception e ) { Log . e ( "Jetty" , "Error stopping httpclient " , e ) ; } finally { client = null ; fileInProgress = null ; } }
download activity is being stopped . stop the httpclient ( note that onpause should always be called first , so the client should be null ) .
