Any idea why?
Because, if that hunk of code is being executed on the main application thread, you are doing network I/O on the main application thread.
I’ve read I might need to implement asynctask but im new to it and not sure what parts need their own thread.
I would put the network I/O and the parsing in doInBackground()
and the setListAdapter()
call in onPostExecute()
of an AsyncTask
.