AsyncTask and Android threads: how to do it right?

I am running AsyncTask to fetch images via HttpClient.

Via DDMS in eclipse, the view shows AsyncTask is running and then hangs.

This is a screenshot of the DDMS streams.

Should AsyncTask thread # 1 disappear or is it benign? What does pending status mean?

+2


source to share


1 answer


If you are really worried before going onPostExecute like this

 protected void onPostExecute(Long result) {
     showDialog("I am finished");
 }

      



If your thread is complete, you don't need to worry about this. It's in Android hands now.

I suspect your thread is going on, but Android is not returning memory because it is not needed yet.

+1


source







All Articles