Hey Everybody,
I have an AsyncTask that posts some data to a server. It does this by calling a static method that I wrote from doInBackground. When I run the AsyncTask,
The code in the doInBackground() method runs on its own thread so you cannot access any UI element from there directly as they are running on the UI thread.
So you got two options.
You handle all the UI stuff in the onPreExecute() and onPostExecute() method which run on the UI thread.
You handle UI stuff in the onProgressUpdate() method which also runs on the UI thread. You can trigger this method from within doInBackground() by calling publishProgress().