-5

How to create and update listview using AsyncTask getting data from server.Actually i am facing the problem for updating the listview i am using the handler and after some second i got update listview but the hadler class continue and when i start new activity related to my app same time if handler is called then my app is being crashed.

nikki
  • 3,248
  • 3
  • 24
  • 29
  • use search button and try something before posting any query here. – PravinCG Feb 22 '12 at 07:07
  • i used the search button after that i posted......... – nikki Feb 22 '12 at 07:13
  • well in that case you need to learn how to search. http://stackoverflow.com/questions/8154042/how-to-update-listview-from-asynctask – PravinCG Feb 22 '12 at 07:15
  • i know how to search i want to know exactly why app being crashed can i used another method for updating the listview and if at that time i called another activity the updating process should run in background..... – nikki Feb 22 '12 at 07:19
  • One thing more for the listiview i am getting data from server and after each 5 seconds i am getting new data. – nikki Feb 22 '12 at 07:20

1 Answers1

1

It's ok if you couldn't find the answer before posting this question.AsyUncTask has the method onPostExecute() that runs in the UIThread once doInBackground() gets completed.You can update your listview in onPostExecute() method once you have got data from server in doInBackground() method thats spawns a new thread.

AndoAiron
  • 694
  • 5
  • 19