Skip to content

Instantly share code, notes, and snippets.

@jinqian
Created May 22, 2013 16:19
Show Gist options
  • Save jinqian/5628877 to your computer and use it in GitHub Desktop.
Save jinqian/5628877 to your computer and use it in GitHub Desktop.
set progress bar progress
// Start lengthy operation in a background thread
new Thread(new Runnable() {
public void run() {
while (mProgressStatus < 100) {
mProgressStatus = doWork();
// Update the progress bar
mHandler.post(new Runnable() {
public void run() {
mProgress.setProgress(mProgressStatus);
}
});
}
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment