コード例 #1
0
    @Override
    protected void onPreExecute() {
      if (dialogShow) {
        progDialog = new ProgressDialog(RssReaderActivity.this);
        progDialog.setCancelable(false);
        progDialog.setMessage(getString(R.string.rss_fetching));
        progDialog.setButton(
            DialogInterface.BUTTON_NEGATIVE,
            getString(R.string.btn_hide_text),
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                Toast.makeText(
                        RssReaderActivity.this, R.string.rss_keep_updating, Toast.LENGTH_SHORT)
                    .show();
              }
            });
        progDialog.show();
      } else
        Toast.makeText(RssReaderActivity.this, R.string.rss_start_updating, Toast.LENGTH_SHORT)
            .show();

      isTaskRunning = true;
    }
コード例 #2
0
  /** @Method: showProgress @Description: ��½ʱ�������ʾ. */
  private void showProgress() {
    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setIcon(R.drawable.l_cn_48);
    mProgressDialog.setTitle("�ϴ���,���Ժ�...");
    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

    mProgressDialog.show();
  }
コード例 #3
0
  void requestAccountList() {
    prog =
        ProgressDialog.show(
            this,
            null,
            getString(R.string.account_list_progress),
            false,
            true,
            new DialogInterface.OnCancelListener() {
              public void onCancel(DialogInterface dialog) {
                cancel();
              }
            });

    queryThread = new Thread(this, "Requestor Thread");
    queryThread.setDaemon(true);
    queryThread.start();
  }
コード例 #4
0
 public KProgressHUD show() {
   if (!isShowing()) {
     mProgressDialog.show();
   }
   return this;
 }
コード例 #5
0
  /**
   * Enable SMS notifications by configuring the VoIP.ms URL callback, registering for GCM and
   * making the appropriate changes to the application preferences.
   *
   * @param activity The source activity.
   */
  public void enableNotifications(final Activity activity) {
    if (preferences.getEmail().equals("")
        || preferences.getPassword().equals("")
        || preferences.getDid().equals("")) {
      Utils.showInfoDialog(
          activity,
          applicationContext.getString(R.string.notifications_callback_username_password_did));
      return;
    }

    final ProgressDialog progressDialog = new ProgressDialog(activity);
    progressDialog.setMessage(activity.getString(R.string.notifications_callback_progress));
    progressDialog.setCancelable(false);
    progressDialog.show();

    new AsyncTask<Boolean, Void, Boolean>() {
      @Override
      protected Boolean doInBackground(Boolean... params) {
        try {
          String url =
              "https://www.voip.ms/api/v1/rest.php?"
                  + "api_username="******"UTF-8")
                  + "&"
                  + "api_password="******"UTF-8")
                  + "&"
                  + "method=setSMS"
                  + "&"
                  + "did="
                  + URLEncoder.encode(preferences.getDid(), "UTF-8")
                  + "&"
                  + "enable=1"
                  + "&"
                  + "url_callback_enable=1"
                  + "&"
                  + "url_callback="
                  + URLEncoder.encode(
                      "http://voipmssms-kourlas.rhcloud.com/sms_callback?did={TO}", "UTF-8")
                  + "&"
                  + "url_callback_retry=0";

          JSONObject result = Utils.getJson(url);
          String status = result.optString("status");
          return !(status == null || !status.equals("success"));
        } catch (Exception ex) {
          return false;
        }
      }

      @Override
      protected void onPostExecute(Boolean success) {
        progressDialog.hide();

        DialogInterface.OnClickListener gcmOnClickListener =
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                gcm.registerForGcm(activity, true, true);
              }
            };

        if (!success) {
          Utils.showAlertDialog(
              activity,
              null,
              applicationContext.getString(R.string.notifications_callback_fail),
              applicationContext.getString(R.string.ok),
              gcmOnClickListener,
              null,
              null);
        } else {
          Utils.showAlertDialog(
              activity,
              null,
              applicationContext.getString(R.string.notifications_callback_success),
              applicationContext.getString(R.string.ok),
              gcmOnClickListener,
              null,
              null);
        }
      }
    }.execute();
  }
コード例 #6
0
ファイル: ImageFlipUI.java プロジェクト: pujyzx/Seetong
 public void showTipDlg(int resId, int timeout, int timeoutMsg) {
   mTipDlg.setTitle(T(resId));
   mTipDlg.setTimeoutToast(T(timeoutMsg));
   mTipDlg.show(timeout);
 }