@Override
  protected Dialog onCreateDialog(int id) {
    if (id == ID_DIALOG_MODERATING) {
      ProgressDialog loadingDialog = new ProgressDialog(CommentsActivity.this);
      if (commentList.checkedCommentTotal <= 1) {
        loadingDialog.setMessage(getResources().getText(R.string.moderating_comment));
      } else {
        loadingDialog.setMessage(getResources().getText(R.string.moderating_comments));
      }
      loadingDialog.setIndeterminate(true);
      loadingDialog.setCancelable(false);
      return loadingDialog;
    } else if (id == ID_DIALOG_REPLYING) {
      ProgressDialog loadingDialog = new ProgressDialog(CommentsActivity.this);
      loadingDialog.setMessage(getResources().getText(R.string.replying_comment));
      loadingDialog.setIndeterminate(true);
      loadingDialog.setCancelable(false);
      return loadingDialog;
    } else if (id == ID_DIALOG_DELETING) {
      ProgressDialog loadingDialog = new ProgressDialog(CommentsActivity.this);
      if (commentList.checkedCommentTotal <= 1) {
        loadingDialog.setMessage(getResources().getText(R.string.deleting_comment));
      } else {
        loadingDialog.setMessage(getResources().getText(R.string.deleting_comments));
      }
      loadingDialog.setIndeterminate(true);
      loadingDialog.setCancelable(false);
      return loadingDialog;
    }

    return super.onCreateDialog(id);
  }
示例#2
0
  @Test
  public void shouldSetIndeterminate() {
    assertThat(dialog.isIndeterminate()).isFalse();

    dialog.setIndeterminate(true);
    assertThat(dialog.isIndeterminate()).isTrue();

    dialog.setIndeterminate(false);
    assertThat(dialog.isIndeterminate()).isFalse();
  }
  public void signup() {
    Log.d(TAG, "Signup");

    if (!validate()) {
      onSignupFailed();
      return;
    }

    _signupButton.setEnabled(false);

    final ProgressDialog progressDialog = new ProgressDialog(SignUpActivity.this, R.style.AppTheme);
    progressDialog.setIndeterminate(true);
    progressDialog.setMessage("Creating Account...");
    progressDialog.show();

    String name = _nameText.getText().toString();
    String email = _emailText.getText().toString();
    String password = _passwordText.getText().toString();

    // TODO: Implement your own signup logic here.

    new android.os.Handler()
        .postDelayed(
            new Runnable() {
              public void run() {
                // On complete call either onSignupSuccess or onSignupFailed
                // depending on success
                onSignupSuccess();
                // onSignupFailed();
                progressDialog.dismiss();
              }
            },
            3000);
  }
示例#4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_go);

    buildGoogleApiClient();
    buildToolBar();

    progressDialog = new ProgressDialog(this);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setMessage("Searching ...");
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.show();

    int x = UIUtils.getScreenWidth(this) - (int) UIUtils.convertDpToPixel(40, this);
    int y = (int) UIUtils.convertDpToPixel(70, this);
    topPadding = Math.min(x, y);

    // Initializing
    markerPoints = new ArrayList<LatLng>();

    // Getting reference to SupportMapFragment of the activity_main
    mMapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);

    mMapFragment.getMapAsync(this);

    // Getting reference to Button
    btnDraw = (Button) findViewById(R.id.btn_draw);
    btnDraw.setVisibility(View.INVISIBLE);
  }
示例#5
0
    // @Override
    protected void onPreExecute() {

      mProgressDialog.setMessage("Loading...");
      mProgressDialog.setIndeterminate(false);
      // Show progress dialog
      mProgressDialog.show();
    }
 public void showWaitDialog(Context cxt) {
   pd = new ProgressDialog(cxt);
   pd.setMessage(cxt.getString(R.string.connecting));
   pd.setIndeterminate(true);
   pd.setCancelable(false);
   pd.show();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    setContentView(R.layout.searchstore_layout);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    // Recibo la palabra de la activity anterior
    Bundle b = this.getIntent().getExtras();

    // La paso a una variable String
    word = b.getString("SearchText");

    result = (TextView) findViewById(R.id.empty_result);
    result.setVisibility(View.INVISIBLE);

    PDialog = new ProgressDialog(this);
    PDialog.setMessage(getString(R.string.searching));
    PDialog.setIndeterminate(false);
    PDialog.setCancelable(false);
    PDialog.show();

    ABar = getActionBar();
    ABar.setDisplayHomeAsUpEnabled(true);

    snc = new SearchNetworkConnection(listener, this);
    ibnc = new InfoBuyNetworkConnection(this);

    ibnc.execute(new Configuration(this).getUserId());

    snc.execute(word);
  }
示例#8
0
 @Override
 protected Dialog onCreateDialog(int id) { // Dialog preference
   Dialog dialog = null;
   switch (id) {
     case 0:
       {
         mProgressDialog = new ProgressDialog(this);
         mProgressDialog.setMessage("회원가입을 요청 중입니다...");
         mProgressDialog.setIndeterminate(true);
         mProgressDialog.setCancelable(true);
         return mProgressDialog;
       }
     case 1:
       {
         AlertDialog.Builder builder = new AlertDialog.Builder(this);
         builder.setTitle("Error");
         builder.setMessage("중복된 메일입니다.");
         builder.setNeutralButton(
             "OK",
             new DialogInterface.OnClickListener() {
               @Override
               public void onClick(DialogInterface dialog, int which) {
                 dialog.dismiss();
               }
             });
         AlertDialog errorAlert = builder.create();
         return errorAlert;
       }
   }
   return null;
 }
示例#9
0
  protected final void processAsync(final int accion) {

    if (!executeAsyncPre(accion)) return;

    dialogWait = new ProgressDialog(getActivity());
    dialogWait.setIndeterminate(true);
    dialogWait.setMessage(wait_message);
    dialogWait.show();

    Thread thread =
        new Thread(
            new Runnable() {
              @Override
              public void run() {
                // TODO Auto-generated method stub
                try {
                  process(accion);

                  handlerIntOK.sendEmptyMessage(accion);

                } catch (Exception e) {
                  // TODO: handle exception
                  handlerIntError.sendEmptyMessage(accion);
                }
              }
            });
    thread.start();
  }
    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
      btDevice = getArguments().getParcelable(KEY_BLUETOOTH_DEVICE);
      getActivity()
          .getApplicationContext()
          .bindService(new Intent(getActivity(), MetaWearBleService.class), this, BIND_AUTO_CREATE);

      reconnectDialog = new ProgressDialog(getActivity());
      reconnectDialog.setTitle(getString(R.string.title_reconnect_attempt));
      reconnectDialog.setMessage(getString(R.string.message_wait));
      reconnectDialog.setCancelable(false);
      reconnectDialog.setCanceledOnTouchOutside(false);
      reconnectDialog.setIndeterminate(true);
      reconnectDialog.setButton(
          DialogInterface.BUTTON_NEGATIVE,
          getString(R.string.label_cancel),
          new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              currentMwBoard.disconnect();
              getActivity().finish();
            }
          });

      return reconnectDialog;
    }
示例#11
0
 public static ProgressDialog wait(Context context, String msg) {
   ProgressDialog dialog = new ProgressDialog(context);
   // 设置进度条风格,风格为圆形,旋转�?
   dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
   // 设置ProgressDialog 标题
   dialog.setTitle(msg);
   // 设置ProgressDialog 提示信息
   // dialog.setMessage("圆形进度�?);
   // 设置ProgressDialog 标题图标
   dialog.setIcon(android.R.drawable.ic_dialog_map);
   // 设置ProgressDialog 的一个Button
   /*
    * dialog.setButton("确定", new ProgressDialog.OnClickListener(){
    *
    * @Override public void onClick(DialogInterface dialog, int which) {
    *
    * } });
    */
   // 设置ProgressDialog 的进度条是否不明�?
   dialog.setIndeterminate(false);
   // 设置ProgressDialog 是否可以按�?回按键取�?
   dialog.setCancelable(true);
   // 显示
   dialog.show();
   return dialog;
 }
示例#12
0
 @Override
 protected void onPreExecute() {
   progress = new ProgressDialog(activity);
   progress.setIndeterminate(true);
   progress.setMessage(activity.getText(R.string.loading));
   progress.show();
 }
 // setup python progressDialog
 private void preparePythonProgress() {
   this.pythonProgress = new ProgressDialog(this);
   pythonProgress.setMessage("Unpacking Python...");
   pythonProgress.setIndeterminate(true);
   pythonProgress.setCancelable(false);
   pythonProgress.show();
 }
 private void startProgress(CharSequence message) {
   if (mProgress == null) {
     mProgress = new NonSearchableProgressDialog(this);
     mProgress.setIndeterminate(true);
     mProgress.setCanceledOnTouchOutside(false);
     setProgressMessage(message != null ? message : getText(R.string.msg_validating_phone));
     mProgress.setOnCancelListener(
         new OnCancelListener() {
           @Override
           public void onCancel(DialogInterface dialog) {
             keepScreenOn(false);
             Toast.makeText(
                     NumberValidation.this, R.string.msg_validation_canceled, Toast.LENGTH_LONG)
                 .show();
             abort();
           }
         });
     mProgress.setOnDismissListener(
         new OnDismissListener() {
           public void onDismiss(DialogInterface dialog) {
             // remove sync starter
             if (mSyncStart != null) {
               mHandler.removeCallbacks(mSyncStart);
               mSyncStart = null;
             }
           }
         });
   }
   mProgress.show();
 }
示例#15
0
  void loginWithFacebookAccessToken(AccessToken accessToken) {
    final ProgressDialog progress = new ProgressDialog(this);
    progress.setMessage(getString(R.string.logging_in));
    progress.setIndeterminate(true);
    progress.setCancelable(false);

    if (null
        != User.getCurrentUser()
            .loginWithFacebook(
                accessToken,
                new ResultCallback.Single<User>() {
                  @Override
                  public void onComplete(
                      @Nullable User user, @Nullable ResultCallback.Error error) {

                    progress.dismiss();
                    if (null != error) {
                      Snackbar.make(mFacebookLoginButton, error.message, Snackbar.LENGTH_LONG)
                          .show();
                      return;
                    }

                    if (user.isAuthenticated()) {
                      Intent intent = new Intent(LoginActivity.this, MainActivity.class);
                      startActivity(intent);
                      finish();
                    }
                  }
                })) {
      progress.show();
    }
  }
示例#16
0
  @Override
  protected Dialog onCreateDialog(int id, Bundle args) {
    final ProgressDialog dialog = new ProgressDialog(this.getParent());
    dialog.setTitle("Please Wait...");
    dialog.setIndeterminate(true);
    dialog.setMessage(String.valueOf(strProgressMessage));
    dialog.setCancelable(true);
    dialog.setOnCancelListener(
        new DialogInterface.OnCancelListener() {
          public void onCancel(DialogInterface dialog) {
            Log.i("LOCATOR", "user cancelling authentication");
          }
        });

    dialog.setOnKeyListener(
        new DialogInterface.OnKeyListener() {
          @Override
          public boolean onKey(DialogInterface arg0, int keyCode, KeyEvent event) {
            // TODO Auto-generated method stub
            if (((keyCode == KeyEvent.KEYCODE_SEARCH) || (keyCode == KeyEvent.KEYCODE_MENU))) {
              return true;
            }
            return false;
          }
        });
    mProgressDialog = dialog;
    return dialog;
  }
示例#17
0
    @Override
    protected void onPreExecute() {
      super.onPreExecute();

      /** INSTANTIATE AND CONFIGURE THE PROGRESS DIALOG * */
      pdUpdateTax = new ProgressDialog(TaxModifier.this);

      pdUpdateTax.setMessage("Please wait while the new Tax is being added.");
      pdUpdateTax.setIndeterminate(false);
      pdUpdateTax.setCancelable(true);
      pdUpdateTax.show();

      /** INSTANTIATE THE DATABASE HELPER CLASS * */
      db = new DBResto(TaxModifier.this);

      /** GET THE TAX NAME FROM THE EDITTEXT * */
      tax_name = edtTaxName.getText().toString().trim();

      /** CONSTRUCT A QUERY TO FETCH THE TAXES ON RECORD * */
      String strQueryData =
          "SELECT * FROM " + db.TAXES + " WHERE " + db.TAX_NAME + " = '" + tax_name + "'";

      /** CAST THE QUERY IN THE CURSOR TO FETCH THE RESULTS * */
      cursor = db.selectAllData(strQueryData);
    }
 @Override
 protected void onPreExecute() {
   progressDialog = new ProgressDialog(this.context);
   progressDialog.setMessage("正在上传照片,请稍候...");
   progressDialog.setIndeterminate(false);
   progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
   progressDialog.setCanceledOnTouchOutside(false);
   progressDialog.setCancelable(true);
   progressDialog.setOnCancelListener(
       new DialogInterface.OnCancelListener() {
         @Override
         public void onCancel(DialogInterface dialogInterface) {
           alertUser();
         }
       });
   progressDialog.setButton(
       DialogInterface.BUTTON_POSITIVE,
       "取消",
       new DialogInterface.OnClickListener() {
         @Override
         public void onClick(DialogInterface dialogInterface, int i) {
           alertUser();
         }
       });
   progressDialog.setMax(total);
   progressDialog.show();
 }
示例#19
0
        public void onItemClick(
            android.widget.AdapterView<?> arg0, View arg1, int arg2, long arg3) {
          String info = arg2 + ""; // ((TextView) arg1).getText().toString();
          /* 	//listview3 cdd1=new listview3(info,getActivity());
          	Bundle arg=new Bundle();
          arg.putString("Menu",info);

          cdd1.getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#40000000")));
          cdd1.show();
          Window window = cdd1.getWindow();
          window.setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

          */
          // Toast.makeText(getApplicationContext(), info, 3000).show();
          arg2--;
          if (arg2 == -1) {
            Intent i = new Intent(getActivity(), AdharScan.class);
            mProgressDialog = new ProgressDialog(getActivity());
            mProgressDialog.setTitle("Location");
            mProgressDialog.setMessage("Fetching...");
            mProgressDialog.setIndeterminate(false);
            mProgressDialog.show();

            startActivity(i);
            mProgressDialog.dismiss();
          }
          if (arg2 == 0) {
            Intent i = new Intent(getActivity(), hospitals.class);
            startActivity(i);
          }
          if (arg2 == 1) {
            Intent i = new Intent(getActivity(), MainSecond.class);
            startActivity(i);
          }
          if (arg2 == 2) {
            Intent i = new Intent(getActivity(), Tax.class);
            startActivity(i);
          }
          if (arg2 == 7) {
            Intent i = new Intent(getActivity(), Right_to_informtion.class);
            startActivity(i);
          }
          if (arg2 == 3) {
            Intent i = new Intent(getActivity(), allindiapincode.class);
            startActivity(i);
          }
          if (arg2 == 4) {
            Intent i = new Intent(getActivity(), bloodbank.class);
            startActivity(i);
          }

          if (arg2 == 5) {
            Intent i = new Intent(getActivity(), mygpsact.class);
            startActivity(i);
          }
          if (arg2 == 6) {
            Intent i = new Intent(getActivity(), mineral_mineral_lease.class);
            startActivity(i);
          }
        }
示例#20
0
 private void createProgressDialog() {
   Log.d(Constants.DEBUG, "CRreate processdialog");
   progressDialog = new ProgressDialog(this);
   progressDialog.setIndeterminate(true);
   progressDialog.setCancelable(true);
   progressDialog.show();
 }
示例#21
0
  protected final void processAsync() {

    if (!isNetworkAvailable()) {
      showToast(error_not_network_message);
      return;
    }

    if (!executeAsyncPre()) return;

    dialogWait = new ProgressDialog(getActivity());
    dialogWait.setIndeterminate(true);
    dialogWait.setMessage(wait_message);
    dialogWait.show();

    Thread thread =
        new Thread(
            new Runnable() {
              @Override
              public void run() {
                // TODO Auto-generated method stub
                try {
                  process();

                  handlerOK.sendEmptyMessage(0);

                } catch (Exception e) {
                  // TODO: handle exception
                  handlerError.sendEmptyMessage(0);
                }
              }
            });
    thread.start();
  }
示例#22
0
 /** 显示进度条对话框 */
 public void showDialog() {
   progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
   progDialog.setIndeterminate(false);
   progDialog.setCancelable(true);
   progDialog.setMessage("正在获取地址");
   // progDialog.show();
 }
示例#23
0
  private void refreshLogs() {
    if (progress != null) {
      progress.dismiss();
    }
    progress = new ProgressDialog(this);
    progress.setMessage(getResources().getText(R.string.loading));
    progress.setIndeterminate(true);
    progress.show();

    new Thread(
            new Runnable() {

              public void run() {
                ArrayList<LogItem> logs =
                    dmesgMode
                        ? collectDLog(
                            Util.getIntOption(LogViewer.this, PREF_KEY_DLOG_LEVL, DM_LVL_DEBUG))
                        : collectCLog(
                            Util.getIntOption(LogViewer.this, PREF_KEY_CLOG_LEVL, Log.VERBOSE),
                            Util.getIntOption(
                                LogViewer.this, PREF_KEY_RING_BUFFER, RING_BUFFER_MAIN),
                            Util.getStringOption(LogViewer.this, PREF_KEY_TAG_FILTER, null),
                            Util.getIntOption(LogViewer.this, PREF_KEY_PID_FILTER, 0));

                handler.sendMessage(handler.obtainMessage(MSG_INIT_OK, logs));
              }
            })
        .start();
  }
示例#24
0
 @Override
 protected void onPreExecute() {
   pd = new ProgressDialog(activity);
   pd.setMessage("Loading...");
   pd.setIndeterminate(false);
   pd.show();
 }
示例#25
0
 void showProgress(int msgId) {
   progress = new ProgressDialog(this);
   progress.setMessage(getString(msgId));
   progress.setIndeterminate(true);
   progress.setCancelable(true);
   progress.setOnCancelListener(abortListener);
   final int msgId2 = msgId;
   progress.setButton(
       DialogInterface.BUTTON_POSITIVE,
       getString(R.string.background),
       new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface d, int which) {
           // Cheat slightly: just launch home screen
           startActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME));
           // Argh, can't prevent a dismiss at this point, so re-show it
           showProgress(msgId2);
           Toast.makeText(SGTPuzzles.this, R.string.bg_unreliable_warn, Toast.LENGTH_LONG).show();
         }
       });
   progress.setButton(
       DialogInterface.BUTTON_NEGATIVE,
       getString(android.R.string.cancel),
       handler.obtainMessage(MsgType.ABORT.ordinal()));
   progress.show();
 }
示例#26
0
  @SuppressWarnings("deprecation")
  @Override
  protected Dialog onCreateDialog(int id) {
    switch (id) {
      case PROGRESS_DIALOG:
        mProgressDialog = new ProgressDialog(this);
        DialogInterface.OnClickListener loadingButtonListener =
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                mLoadPlaceTask.cancel(true);
                mLoadPlaceTask.setListener(null);
                finish();
              }
            };
        mProgressDialog.setTitle(getString(R.string.loading_place));

        int resourceId =
            this.getResources().getIdentifier("please_wait", "string", this.getPackageName());
        mProgressDialog.setMessage(this.getString(resourceId));
        mProgressDialog.setIndeterminate(true);
        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        mProgressDialog.setCancelable(false);
        mProgressDialog.setButton(getString(R.string.cancel), loadingButtonListener);
        return mProgressDialog;
    }
    return null;
  }
 @Override
 protected Dialog onCreateDialog(int id) {
   super.onCreateDialog(id);
   switch (id) {
     case R.string.cache_clear_warning:
       return new ConfirmDialogBuilder(this, R.string.cache_clear_warning, this)
           .setMessage(R.string.cache_clear_warning)
           .create();
     case R.string.security_clear_certificate_warning:
       return new ConfirmDialogBuilder(this, R.string.security_clear_certificate_warning, this)
           .setMessage(R.string.security_clear_certificate_warning)
           .create();
     case R.string.contacts_reset_offline_warning:
       return new ConfirmDialogBuilder(this, R.string.contacts_reset_offline_warning, this)
           .setMessage(R.string.contacts_reset_offline_warning)
           .create();
     case R.string.application_state_closing:
       ProgressDialog progressDialog = new ProgressDialog(this);
       progressDialog.setMessage(getString(R.string.application_state_closing));
       progressDialog.setCancelable(false);
       progressDialog.setIndeterminate(true);
       return progressDialog;
     default:
       return null;
   }
 }
 /**
  * TODO: change Toast messages to another AlertDialog (i do not know how to do this, i hate
  * Android UI)
  *
  * @param emailAddress
  * @param emailDomain
  */
 private void sendResetPasswordEmail(final String emailAddress) {
   final ProgressDialog resetPasswordProgressDialog = new ProgressDialog(context);
   resetPasswordProgressDialog.setTitle(getString(R.string.label_reset_password));
   resetPasswordProgressDialog.setMessage(getString(R.string.dialog_resetting_password));
   resetPasswordProgressDialog.setIndeterminate(true);
   resetPasswordProgressDialog.setCancelable(true);
   resetPasswordProgressDialog.setOnCancelListener(
       new OnCancelListener() {
         @Override
         public void onCancel(DialogInterface dialog) {
           dialog.dismiss();
         }
       });
   resetPasswordProgressDialog.show();
   Thread thread =
       new Thread(
           new Runnable() {
             @Override
             public void run() {
               Looper.prepare();
               try {
                 lewaAuthService.resetPassword(
                     new SendResetPasswordEmailHandler(resetPasswordProgressDialog), emailAddress);
               } catch (APIException e) {
                 Log.e(TAG, "api exception not caught"); // can never get
                 // here
               } catch (IOException e) {
                 Log.e(TAG, "io exception not caught"); // can never get here
               }
             }
           });
   thread.start();
 }
示例#29
0
 // PRE-EJECUCION: esto se ejecutara ANTES del background, en este caso muestra un dialogo de
 // proceso y un mensaje que se puede editar
 protected void onPreExecute() {
   pDialog = new ProgressDialog(LoginActivity.this);
   pDialog.setMessage("Autenticando ...");
   pDialog.setIndeterminate(false);
   pDialog.setCancelable(true);
   pDialog.show();
 }
示例#30
0
 public void initprogress() {
   progressDialog = new ProgressDialog(this);
   progressDialog.setMessage("En cours de création ...");
   progressDialog.setIndeterminate(true);
   progressDialog.setCancelable(false);
   progressDialog.show();
 }