Android HttpClient persistent cookies

后端 未结 4 1060
眼角桃花
眼角桃花 2020-11-30 02:10

UPDATE: This question and its answers should no longer be recommended to anyone reading this. Android no-longer recommends HttpClient (read: deprecated), and instead

4条回答
  •  既然无缘
    2020-11-30 02:23

    define HttpClient in Application class, and use it in activity.

    in Application

    public class AAA extends Application {
        public HttpClient httpClient; 
    
        httpClient = new DefaultHttpClient(); 
    

    in Activity

    AAA aaa = (AAA)getApplication();
    httpClient = app.httpClient;
    

提交回复
热议问题