i got a problem in updating progress bar. I am updating progress bar in separate Thread and the variable on which the progressbar progress is depending(which is a class variable
You are updating progress bar inisde a thread's run method. you cannot update ui from a thread. You need to update ui on the ui thread. Use runOnUiThread
. runOnUiThread
is a method of activity class.
Or Use Asynctask.
http://developer.android.com/reference/android/os/AsyncTask.html
In asynctask doInBackground
you can call publishProgress(Progress...)
to publish one or more units of progress. These values are published on the UI thread, in the onProgressUpdate(Progress...)
step.