I have in Android:
HttpResponse httpGetResponse = client.execute(request);
...
Log.e("HEADER: ", httpGetResponse.getStatusLine().toString() );
i.e. I execute a HttpGet request and then do something with the response. Yet I want to somehow place it into a separate thread, so that the UI thread won’t freeze while the server responds. What do you think would be the best way to do that?
Thansk!
Wrap your request into an AsyncTask and do the actual request in the doInBackground. As you probably have to use the output on the UI thread you probably should return the data you need from within the doInBackground and use the postExecute option in AsyncTask.