This is something I’ve been trying for quite a while and this is the closest I have come. Hopefully someone can help me take this the extra step to actually fill up a ListView. At the moment the data is retrieved as it shows up in my logcat. I need it to appear in the actual application now in the form of a ListView since there are two columns.
My code is quite long so here is a link to it on pastebin: http://pastebin.com/XzTtTJ3j
The current code has no errors, it doesn’t throw any of the exceptions but of course at the same time it does nothing. Just shows my data in the logcat as a string, the page in the application is blank. I’ve looked at tutorials and when I’ve tried to implement them I get errors. I’m guessing it has something to do with the fact I’m using AsyncTask..? My layout file consists of two textviews and a listview in a relativelayout.
Any ideas? Would really appreciate the help. Thanks!
I think you need to show your onPostExecute()? doInBackground()’s return value should be processed in onPostExecute() and do necessary UI updates there.
doInBackground() doesn’t natively communicate with the UI thread, so that’s where onPostExecute() comes in. You will, of course, still need to do some work to update your ListView with the results.
http://developer.android.com/reference/android/os/AsyncTask.html#onPostExecute(Result)