Example #1
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);
   }
 }
Example #2
0
 @Override
 protected void onPrepareDialog(int id, Dialog dialog) {
   switch (id) {
     case PROGRESS_DIALOG:
       progressDialog.setProgress(0);
       progressThread = new ProgressThread(handler);
       progressThread.start();
   }
 }
Example #3
0
  private static void creerProgressDialog() {
    mProgressDialog = new ProgressDialog(AppData.currentContext);
    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    mProgressDialog.setTitle(AppData.currentContext.getString(R.string.loading));
    mProgressDialog.setMessage(AppData.currentContext.getString(R.string.startLoading));

    mProgressDialog.setMax(100);
    mProgressDialog.setProgress(0);
    mProgressDialog.setCancelable(false);
  }
Example #4
0
 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);
   }
 }
Example #5
0
 /**
  * Set current progress. Only have effect when use with a determinate style, or a custom view
  * which implements Determinate interface.
  */
 public void setProgress(int progress) {
   mProgressDialog.setProgress(progress);
 }