Esempio n. 1
0
 @Override
 protected Dialog onCreateDialog(int id) {
   switch (id) {
     case PROGRESS_DIALOG:
       progressDialog = new ProgressDialog(D4.this);
       progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
       progressDialog.setMessage("Loading...");
       return progressDialog;
     default:
       return null;
   }
 }
Esempio n. 2
0
 @Override
 protected void onPrepareDialog(int id, Dialog dialog) {
   switch (id) {
     case PROGRESS_DIALOG:
       progressDialog.setProgress(0);
       progressThread = new ProgressThread(handler);
       progressThread.start();
   }
 }
Esempio n. 3
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);
   }
 }