How to cancel DefaulHttpClient execution process in multithread

后端 未结 4 1156
北恋
北恋 2021-01-03 17:14

I am developing an android application that rely very much on internet, I retrieve data frequently using this RestClient Class, that wrap some detail on using DefaultHttpCli

4条回答
  •  梦毁少年i
    2021-01-03 17:48

    I suggest you take a look at the ClientConnectionManager interface. This allows you to do stuff like releasing a connection, shutting down a connection etc. You may need to enhance the implementation of RestClient though - since your RestClient does not expose the underlying DefaultHttpClient object (from which you can get to the ClientConnectionManager using the getClientConnectionManager() method).

提交回复
热议问题