@Override protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case PROGRESS_DIALOG: progressDialog.setProgress(0); progressThread = new ProgressThread(handler); progressThread.start(); } }
@Override public void handleMessage(Message msg) { int total = msg.arg1; progressDialog.setProgress(total); if (total >= 100) { dismissDialog(PROGRESS_DIALOG); progressThread.setState(ProgressThread.STATE_DONE); } }
public void handleMessage(Message msg) { mValue++; mText.setText(Integer.toString(mValue)); try { Thread.sleep(50); } catch (InterruptedException e) {; } if (mValue < 100 && mQuit == false) { mProgress.setProgress(mValue); mHandler.sendEmptyMessage(0); } else { dismissDialog(0); } }