Ejemplo n.º 1
0
        @Override
        public void onClick(View dialog) {
          if (alertStatus == ALERTCALL_COUNTDOWN) {
            alertCountdown = 0;
          }

          if (alertStatus == ALERTCALL_CANCELED) {
            alertDialog.cancel();
          }

          if (alertStatus == ALERTCALL_EXECUTED) {
            alertDialog.cancel();
          }
        }
Ejemplo n.º 2
0
 @Override
 public void onClick(View v) {
   // TODO Auto-generated method stub
   RWSharedPreferences pre = new RWSharedPreferences(context, "addInfo");
   context.sessionId = pre.getStringValue("sessionid");
   context.phonenum = pre.getStringValue("phonenum");
   context.userno = pre.getStringValue("userno");
   if (context.userno == null || context.userno.equals("")) {
     Intent intentSession = new Intent(context, UserLogin.class);
     context.startActivityForResult(intentSession, 0);
   } else if (zhuShu == 0) {
     Toast.makeText(context, "请选择过关方式", Toast.LENGTH_SHORT).show();
   } else {
     dialog.cancel();
     if (isAmtDialog()) {
       alertInfo(
           context.getString(R.string.jc_main_touzhu_alert_text_content),
           context.getString(R.string.jc_main_touzhu_alert_text_title));
     } else {
       switch (v.getId()) {
         case R.id.alert_dialog_touzhu_button_cancel:
           initBet();
           context.toJoinActivity();
           break;
         case R.id.alert_dialog_touzhu_button_ok:
           beginTouzhu();
           break;
       }
     }
   }
 }
Ejemplo n.º 3
0
 @SuppressLint("NewApi")
 public void closeDialog() {
   if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD_MR1) return;
   if (null != dialog && dialog.isShowing()) {
     dialog.cancel();
   }
 }
Ejemplo n.º 4
0
  /** Called when there's a change to the downloads database. */
  void handleDownloadsChanged() {
    checkSelectionForDeletedEntries();

    if (mQueuedDownloadId != null && moveToDownload(mQueuedDownloadId)) {
      if (mDateSortedCursor.getInt(mStatusColumnId) != DownloadManager.STATUS_PAUSED
          || !isPausedForWifi(mDateSortedCursor)) {
        mQueuedDialog.cancel();
      }
    }
  }
Ejemplo n.º 5
0
 public void destroyAlertWaiter() {
   mAlertsActive = false;
   if (mAlertDialog != null) {
     mAlertDialog.cancel();
     mAlertDialog = null;
   }
   if (mAlertTask != null) {
     mAlertTask.cancel(true);
     mAlertTask = null;
   }
 }
Ejemplo n.º 6
0
 @Override
 protected void onPostExecute(Integer result) {
   dialog.cancel();
   Cursor cursor =
       getContentResolver()
           .query(
               JTalkProvider.ACCOUNT_URI,
               null,
               AccountDbHelper.ENABLED + " = '" + 1 + "'",
               null,
               null);
   if (cursor == null || cursor.getCount() < 1)
     startActivity(new Intent(RosterActivity.this, Accounts.class));
 }
Ejemplo n.º 7
0
 /** 投注方法 */
 private void touZhu() {
   toLogin = false;
   touZhuDialog.cancel();
   initBet();
   // TODO Auto-generated method stub
   if (isGift) {
     toActivity(addView.getsharezhuma());
   } else if (isJoin) {
     toJoinActivity();
   } else if (isTouzhu) {
     touZhuNet();
   }
   clearProgress();
 }
 public void onDestroy() {
   super.onDestroy();
   MainMenu.basicWirelessEvent = null;
   if (dialWPSsession != null && dialWPSsession.isShowing()) {
     dialWPSsession.cancel();
   }
   if (dialWPSpinentry != null && dialWPSpinentry.isShowing()) {
     dialWPSpinentry.cancel();
   }
   if (bwsalertdialog != null && bwsalertdialog.isShowing()) {
     bwsalertdialog.cancel();
   }
   if (timr != null) {
     timr.cancel();
   }
   if (looper != null) {
     looper.quit();
   }
   defPrefEditor.putString(L10NConstants.CONFIG_KEY, "");
   defPrefEditor.commit();
 }
Ejemplo n.º 9
0
  /*
   * This is called for activities that set launchMode to "singleTop" or
   * "singleTask" in their manifest package, or if a client used the
   * FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).
   */
  @Override
  protected void onNewIntent(Intent intent) {
    Log.d(TAG, "onNewIntent: " + intent);

    if (!mWriteMode) {
      // Currently in tag READING mode
      if (intent.getAction().equals(NfcAdapter.ACTION_NDEF_DISCOVERED)) {
        NdefMessage[] msgs = getNdefMessagesFromIntent(intent);
        confirmDisplayedContentOverwrite(msgs[0]);
      } else if (intent.getAction().equals(NfcAdapter.ACTION_TAG_DISCOVERED)) {
        Toast.makeText(
                this, "This NFC tag currently has no inventory NDEF data.", Toast.LENGTH_LONG)
            .show();
      }
    } else {
      // Currently in tag WRITING mode
      if (intent.getAction().equals(NfcAdapter.ACTION_TAG_DISCOVERED)) {
        Tag detectedTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
        writeTag(createNdefFromJson(), detectedTag);
        mWriteTagDialog.cancel();
      }
    }
  }
 private void hideLocationErrorAlertDialogBox() {
   locationErrorAlert.cancel();
 }
 private void hideInternetErrorAlertDialogBox() {
   internetErrorAlert.cancel();
 }
 public static void hideConfirm() {
   if (logout != null) {
     logout.cancel();
     logout = null;
   }
 }
Ejemplo n.º 13
0
 private void cancelDialog() {
   if (mDialog != null && mDialog.isShowing()) {
     mDialog.cancel();
   }
 }
 @Override
 public void cancel() {
   if (mDialog != null) {
     mDialog.cancel();
   }
 }
Ejemplo n.º 15
0
  public void createAlertWaiter() {
    mAlertsActive = true;
    // All mupdf library calls are performed on asynchronous tasks to avoid stalling
    // the UI. Some calls can lead to javascript-invoked requests to display an
    // alert dialog and collect a reply from the user. The task has to be blocked
    // until the user's reply is received. This method creates an asynchronous task,
    // the purpose of which is to wait of these requests and produce the dialog
    // in response, while leaving the core blocked. When the dialog receives the
    // user's response, it is sent to the core via replyToAlert, unblocking it.
    // Another alert-waiting task is then created to pick up the next alert.
    if (mAlertTask != null) {
      mAlertTask.cancel(true);
      mAlertTask = null;
    }
    if (mAlertDialog != null) {
      mAlertDialog.cancel();
      mAlertDialog = null;
    }
    mAlertTask =
        new AsyncTask<Void, Void, MuPDFAlert>() {

          @Override
          protected MuPDFAlert doInBackground(Void... arg0) {
            if (!mAlertsActive) return null;

            return core.waitForAlert();
          }

          @Override
          protected void onPostExecute(final MuPDFAlert result) {
            // core.waitForAlert may return null when shutting down
            if (result == null) return;
            final MuPDFAlert.ButtonPressed pressed[] = new MuPDFAlert.ButtonPressed[3];
            for (int i = 0; i < 3; i++) pressed[i] = MuPDFAlert.ButtonPressed.None;
            DialogInterface.OnClickListener listener =
                new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
                    mAlertDialog = null;
                    if (mAlertsActive) {
                      int index = 0;
                      switch (which) {
                        case AlertDialog.BUTTON1:
                          index = 0;
                          break;
                        case AlertDialog.BUTTON2:
                          index = 1;
                          break;
                        case AlertDialog.BUTTON3:
                          index = 2;
                          break;
                      }
                      result.buttonPressed = pressed[index];
                      // Send the user's response to the core, so that it can
                      // continue processing.
                      core.replyToAlert(result);
                      // Create another alert-waiter to pick up the next alert.
                      createAlertWaiter();
                    }
                  }
                };
            mAlertDialog = mAlertBuilder.create();
            mAlertDialog.setTitle(result.title);
            mAlertDialog.setMessage(result.message);
            switch (result.iconType) {
              case Error:
                break;
              case Warning:
                break;
              case Question:
                break;
              case Status:
                break;
            }
            switch (result.buttonGroupType) {
              case OkCancel:
                mAlertDialog.setButton(AlertDialog.BUTTON2, getString(R.string.cancel), listener);
                pressed[1] = MuPDFAlert.ButtonPressed.Cancel;
              case Ok:
                mAlertDialog.setButton(AlertDialog.BUTTON1, getString(R.string.okay), listener);
                pressed[0] = MuPDFAlert.ButtonPressed.Ok;
                break;
              case YesNoCancel:
                mAlertDialog.setButton(AlertDialog.BUTTON3, getString(R.string.cancel), listener);
                pressed[2] = MuPDFAlert.ButtonPressed.Cancel;
              case YesNo:
                mAlertDialog.setButton(AlertDialog.BUTTON1, getString(R.string.yes), listener);
                pressed[0] = MuPDFAlert.ButtonPressed.Yes;
                mAlertDialog.setButton(AlertDialog.BUTTON2, getString(R.string.no), listener);
                pressed[1] = MuPDFAlert.ButtonPressed.No;
                break;
            }
            mAlertDialog.setOnCancelListener(
                new DialogInterface.OnCancelListener() {
                  public void onCancel(DialogInterface dialog) {
                    mAlertDialog = null;
                    if (mAlertsActive) {
                      result.buttonPressed = MuPDFAlert.ButtonPressed.None;
                      core.replyToAlert(result);
                      createAlertWaiter();
                    }
                  }
                });

            mAlertDialog.show();
          }
        };

    mAlertTask.executeOnExecutor(new ThreadPerTaskExecutor());
  }
Ejemplo n.º 16
0
        @Override
        public void run() {
          alertDialog.cancel();

          launchAlertChat(true);
        }
Ejemplo n.º 17
0
 void closeInternetAlert() {
   if (dialog.isShowing()) {
     dialog.cancel();
   }
 }
Ejemplo n.º 18
0
 private void btnCancelListDialog() {
   listDialog.cancel();
 }