1

I am new to android and I have done an online chat app. The problem is when I request 'http post' repeatedly to refresh my chat screen, the app hangs and I cannot perform any other operations.

1 Answers1

0

Your Application freezes because you are performing a network operation within the Main Thread and you are blocking it.

This Asynctask tutorial and this blog will help you.

  • how to populate async task result to listview? – user1684892 Sep 28 '12 at 11:33
  • You can pass ListView in your AsyncTask. To get the result from AsyncTask, there is a method called onPostResult(Result) . so you can update your listview. Note: Don't update listview from doInBackground(). –  Sep 29 '12 at 04:19