I\'m trying to fix a Thread error for one of my preferred examples from java code geeks.
Here\'s the code:
public class JsonParsingActivity extends A
You can't do UI
stuff in doInBackground()
. Hence, you can't display a Toast
there. You need to move this to onPostExecute()
or somewhere else. Possibly onProgressUpdate()
You could call publishProgress(results)
and show the Toast
in onProgressUpdate()
or return results
to onPostExecute()
and display it there. You also have the option of sending the data back to an Activity
method
AsyncTask