Beispiel #1
0
 @Override
 protected void onPrepareDialog(int id, Dialog dialog) {
   switch (id) {
     case PROGRESS_DIALOG:
       progressDialog.setProgress(0);
       progressThread = new ProgressThread(handler);
       progressThread.start();
   }
 }
Beispiel #2
0
 @Override
 public void handleMessage(Message msg) {
   int total = msg.arg1;
   progressDialog.setProgress(total);
   if (total >= 100) {
     dismissDialog(PROGRESS_DIALOG);
     progressThread.setState(ProgressThread.STATE_DONE);
   }
 }