示例#1
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case 1:
       Toast.makeText(ActLogin.this, strMessage, Toast.LENGTH_LONG).show();
       Intent intent = new Intent();
       if (lv.getIsNewRegister()) {
         intent.setClass(ActLogin.this, ActSearchUser.class);
         lv.setIsNewRegister(false);
         startActivity(intent);
       }
       // else {
       // intent.setClass(ActLogin.this, ActPerson.class);
       // }
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       lv.setIsNewLogin(true);
       ActLogin.this.finish();
       break;
     case 2:
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       Toast.makeText(ActLogin.this, strMessage, Toast.LENGTH_LONG).show();
       break;
   }
 }
  private void showUpdateDialog(final VersionInfo info) {
    AlertDialog.Builder dlg =
        new AlertDialog.Builder(mContext, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);

    final View layout = LayoutInflater.from(mContext).inflate(R.layout.umeng_update_dialog, null);
    final TextView versionUpdateContent = (TextView) layout.findViewById(R.id.umeng_update_content);
    final Button okBtn = (Button) layout.findViewById(R.id.umeng_update_id_ok);
    final Button cancelBtn = (Button) layout.findViewById(R.id.umeng_update_id_cancel);
    final Button closeBtn = (Button) layout.findViewById(R.id.umeng_update_id_close);
    final CheckBox ignoreThisVersion = (CheckBox) layout.findViewById(R.id.umeng_update_id_check);

    View.OnClickListener onCancelClicked =
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            if (ignoreThisVersion.isChecked()) {
              SharedPreferences sharedPreferences =
                  mContext.getSharedPreferences(UPDATE_MANAGER_PREFERENCES, Activity.MODE_PRIVATE);
              SharedPreferences.Editor editor = sharedPreferences.edit();
              editor.putInt(KEY_IGNORE_VERSION_CODE, info.versionCode);
              editor.commit();
            }
            mUpgradDlg.dismiss();
          }
        };

    String updateContent =
        String.format(
            Locale.CHINA,
            "%s:%s\n%s:\n%s",
            mContext.getString(R.string.app_versionTitle),
            info.versionName,
            mContext.getString(R.string.update_content),
            info.updateContent);
    versionUpdateContent.setText(updateContent);
    cancelBtn.setOnClickListener(onCancelClicked);
    closeBtn.setOnClickListener(onCancelClicked);
    okBtn.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            upgrade(info);
            mUpgradDlg.dismiss();
          }
        });

    dlg.setView(layout);
    dlg.setCancelable(false);

    if (mUpgradDlg != null) {
      if (mUpgradDlg.isShowing()) {
        mUpgradDlg.dismiss();
      }
    }

    mUpgradDlg = dlg.create();
    mUpgradDlg.show();
  }
示例#3
0
 @Override
 public void onStop() {
   super.onStop();
   if (mClearSearchHistoryDialog != null && mClearSearchHistoryDialog.isShowing()) {
     mClearSearchHistoryDialog.dismiss();
   }
 }
示例#4
0
 @SuppressLint("NewApi")
 public void closeDialog() {
   if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD_MR1) return;
   if (null != dialog && dialog.isShowing()) {
     dialog.cancel();
   }
 }
 @Override
 protected void onPause() {
   super.onPause();
   if (mAlertDialog != null && mAlertDialog.isShowing()) {
     mAlertDialog.dismiss();
   }
 }
 @Override
 public void clearTimeoutDialog() {
   if (mServerTimeoutDialog != null && mServerTimeoutDialog.isShowing()) {
     mServerTimeoutDialog.dismiss();
   }
   mServerTimeoutDialog = null;
 }
 @Override
 protected void onPause() {
   super.onPause();
   if (helpDialog != null && helpDialog.isShowing()) {
     helpDialog.dismiss();
   }
 }
示例#8
0
 public boolean b() {
   if (b != null) {
     return b.isShowing();
   } else {
     return false;
   }
 }
示例#9
0
 @Override
 public void handleMessage(Message msg) {
   // TODO Auto-generated method stub
   switch (msg.what) {
     case uSDKNotificationCenter.DEVICE_STATUS_CHANGED_NOTIFY:
       HashMap<String, HashMap<String, uSDKDeviceAttribute>> maps =
           (HashMap<String, HashMap<String, uSDKDeviceAttribute>>) msg.obj;
       HashMap<String, uSDKDeviceAttribute> attrs = maps.get(mDevice.getDeviceMac());
       mHandler.obtainMessage(Const.MSG_DEVICE_ATTRIBUTE_CHANGE, attrs).sendToTarget();
       Log.d(
           "test",
           "DEVICE_STATUS_CHANGED_NOTIFY  mDevice.size-->" + mDevice.getAttributeMap());
       initDeviceInfo(mDevice.getAttributeMap());
       break;
     case uSDKNotificationCenter.DEVICE_OPERATION_ACK_NOTIFY:
       HashMap<Integer, HashMap<String, uSDKDeviceAttribute>> cmd_maps =
           (HashMap<Integer, HashMap<String, uSDKDeviceAttribute>>) msg.obj;
       HashMap<String, uSDKDeviceAttribute> res_maps = cmd_maps.get(1000);
       initDeviceInfo(mDevice.getAttributeMap());
       break;
     case uSDKNotificationCenter.DEVICE_ALARM_NOTIFY:
       Log.d("test", "DEVICE_ALARM_NOTIFY ");
       HashMap<String, ArrayList<uSDKDeviceAlarm>> alarmList =
           (HashMap<String, ArrayList<uSDKDeviceAlarm>>) msg.obj;
       ArrayList<uSDKDeviceAlarm> deviceAlarmList = alarmList.get(mDevice.getDeviceMac());
       if (deviceAlarmList != null && deviceAlarmList.size() > 0) {
         String alarmContent = "";
         for (uSDKDeviceAlarm ala : deviceAlarmList) {
           alarmContent += ala.getAlarmMessage();
         }
         if (mAlarmDialog != null) {
           if (mAlarmDialog.isShowing()) {
             mAlarmDialog.setMessage(oldAlarmContent + "\n" + alarmContent);
             oldAlarmContent = oldAlarmContent + "\n" + alarmContent;
           } else {
             mAlarmDialog.setMessage(alarmContent);
             mAlarmDialog.show();
             oldAlarmContent = alarmContent;
           }
         } else {
           mAlarmDialog = getAlarmDialog(alarmContent.toString());
           mAlarmDialog.show();
           oldAlarmContent = alarmContent;
         }
       }
       break;
     case uSDKNotificationCenter.DEVICE_ONLINE_CHANGED_NOTIFY:
       HashMap<String, uSDKDeviceStatusConst> map =
           (HashMap<String, uSDKDeviceStatusConst>) msg.obj;
       if (map != null && map.size() > 0) {
         uSDKDeviceStatusConst online = map.get(mDeviceMac);
         if (online != null) {
           Toast.makeText(OvenControlFragment.this, "当前的设备装备:" + online.getValue(), 3000)
               .show();
         }
       }
       break;
   }
 }
 @Override
 protected void onPause() {
   Log.i(t, "onPause: Pausing upload of " + mInstancesToSend.length + " instances!");
   super.onPause();
   if (mAlertDialog != null && mAlertDialog.isShowing()) {
     mAlertDialog.dismiss();
   }
 }
示例#11
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case 1:
       Toast.makeText(ActFindPwd.this, strMessage, Toast.LENGTH_LONG).show();
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       ActFindPwd.this.finish();
       break;
     case 2:
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       Toast.makeText(ActFindPwd.this, strMessage, Toast.LENGTH_LONG).show();
       break;
   }
 }
示例#12
0
  @Override
  protected void onPause() {
    super.onPause();

    if (mAlertDialog != null) if (mAlertDialog.isShowing()) mAlertDialog.dismiss();

    saveComplexPreferences();
  }
示例#13
0
        @Override
        public void onVideoChatStateChange(
            CallState callState, VideoChatConfig receivedVideoChatConfig) {
          videoChatConfig = receivedVideoChatConfig;

          switch (callState) {
            case ON_CALL_START:
              // Toast.makeText(getBaseContext(), "ON_CALL_START",
              // Toast.LENGTH_SHORT).show();
              break;
            case ON_CANCELED_CALL:
              // Toast.makeText(getBaseContext(), "ON_CANCELED_CALL",
              // Toast.LENGTH_SHORT).show();
              videoChatConfig = null;
              if (alertDialog != null && alertDialog.isShowing()) {
                alertDialog.dismiss();
              }
              SoundPoolMusic.stopMusic();
              autoCancelHandler.removeCallbacks(autoCancelTask);

              break;
            case ON_CALL_END:
              Toast.makeText(getBaseContext(), "通话结束", Toast.LENGTH_SHORT).show();
              SoundPoolMusic.stopMusic();
              Intent intent = new Intent(AudioChatActivity.this, ConversationActivity.class);
              startActivity(intent);
              finish();
              // clear opponent view
              break;
            case ACCEPT:
              // Toast.makeText(getBaseContext(), "ACCEPT",
              // Toast.LENGTH_SHORT)
              // .show();
              // showIncomingCallDialog();
              break;
            case ON_ACCEPT_BY_USER:
              Toast.makeText(getBaseContext(), "对方已接受,载入中...", Toast.LENGTH_SHORT).show();
              SoundPoolMusic.stopMusic();
              QBVideoChatController.getInstance().onAcceptFriendCall(videoChatConfig, null);
              break;
            case ON_REJECTED_BY_USER:
              Toast.makeText(getBaseContext(), "对方拒接", Toast.LENGTH_SHORT).show();
              SoundPoolMusic.stopMusic();
              Intent intent2 = new Intent(AudioChatActivity.this, ConversationActivity.class);
              startActivity(intent2);
              finish();

              break;
            case ON_CONNECTED:
              // Toast.makeText(getBaseContext(), "ON_CONNECTED",
              // Toast.LENGTH_SHORT).show();
              break;
            case ON_START_CONNECTING:
              // Toast.makeText(getBaseContext(), "ON_START_CONNECTING",
              // Toast.LENGTH_SHORT).show();
              break;
          }
        }
  @Override
  protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();

    if (mPopup != null && mPopup.isShowing()) {
      mPopup.dismiss();
      mPopup = null;
    }
  }
示例#15
0
 public void dismissProgressDialog() {
   if (mProgressDialog != null && mProgressDialog.isShowing()) {
     //            AnimationDrawable drawable = (AnimationDrawable)
     // mProgressImageView.getDrawable();
     //            drawable.stop();
     if (ivLoading != null) ivLoading.clearAnimation();
     mProgressDialog.dismiss();
   }
 }
示例#16
0
  /** 打开配置对话框. */
  public void openSettingDlg() {
    daemonSignal++;
    spinnerStop();
    if (settingDialog != null && settingDialog.isShowing()) {
      return;
    }

    Builder settingBuilder = new AlertDialog.Builder(this);
    settingBuilder.setTitle(R.string.settingDlgTitle);
    final TableLayout loginSettingForm =
        (TableLayout) getLayoutInflater().inflate(R.layout.settingdlg, null);
    settingBuilder.setView(loginSettingForm);
    settingBuilder.setPositiveButton(
        R.string.save,
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) {
            String url =
                StringUtils.toBj(
                    ((EditText) loginSettingForm.findViewById(R.id.url)).getText().toString());
            String newUser =
                ((EditText) loginSettingForm.findViewById(R.id.userName)).getText().toString();
            String newPassword =
                ((EditText) loginSettingForm.findViewById(R.id.password)).getText().toString();

            sharedEditor.putString(F_URL, url);
            sharedEditor.putString(F_USERNAME, newUser);
            sharedEditor.putString(F_PASSWORD, newPassword);
            sharedEditor.commit();
            contentWebView.clearView();
            dialog.dismiss();
            loadSystem();
          }
        });
    settingBuilder.setNegativeButton(
        R.string.close,
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
            System.out.println(loadSuccess);
            System.out.println(PortalActivity.this.loadSuccess);
            if (!loadSuccess) {
              confirmExit();
            }
          }
        });

    String url = sharedPreferences.getString(F_URL, DF_URL);
    url = StringUtils.toBj(url);
    String userName = sharedPreferences.getString(F_USERNAME, DF_USERNAME);
    String password = sharedPreferences.getString(F_PASSWORD, DF_PASSWORD);

    ((EditText) loginSettingForm.findViewById(R.id.url)).setText(url);
    ((EditText) loginSettingForm.findViewById(R.id.userName)).setText(userName);
    ((EditText) loginSettingForm.findViewById(R.id.password)).setText(password);
    settingDialog = settingBuilder.create();
    settingDialog.show();
  }
示例#17
0
 @Override
 public Parcelable onSaveInstanceState() {
   Parcelable superState = super.onSaveInstanceState();
   FindPanelSavedState ss = new FindPanelSavedState(superState);
   ss.replaceBarVisibility = _replaceBar.getVisibility();
   ss.optionsCaseSensitive = _caseSensitive.isChecked();
   ss.optionsWholeWord = _matchWholeWord.isChecked();
   ss.optionsDialogShown = _optionsDialog.isShowing();
   return ss;
 }
示例#18
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   Log.v(MAIN_ACTIVITY_TAG, "(6) OverrideOnDestroy");
   if (mDialog != null) {
     if (mDialog.isShowing()) {
       mDialog.dismiss();
     }
   }
 }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   if (mIsAddingNewSubtype) {
     outState.putBoolean(KEY_IS_ADDING_NEW_SUBTYPE, true);
   }
   if (mSubtypeEnablerNotificationDialog != null
       && mSubtypeEnablerNotificationDialog.isShowing()) {
     outState.putBoolean(KEY_IS_SUBTYPE_ENABLER_NOTIFICATION_DIALOG_OPEN, true);
     outState.putString(KEY_SUBTYPE_FOR_SUBTYPE_ENABLER, mSubtypePreferenceKeyForSubtypeEnabler);
   }
 }
示例#20
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    Log.v(MAIN_ACTIVITY_TAG, "(7) OverrideOnSaveInstanceState");

    if (mDialog != null) {
      if (mDialog.isShowing()) {
        Log.v(MAIN_ACTIVITY_TAG, "dialogIsShowing");
        outState.putInt(KEY_DIALOG, 1);
      }
    }
  }
示例#21
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case 1:
       lv.setIsNewRegister(true);
       Toast.makeText(ActRegister.this, strMessage, Toast.LENGTH_LONG).show();
       Intent i = new Intent();
       ActRegister.this.setResult(RESULT_OK, i);
       ActRegister.this.finish();
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       ActRegister.this.finish();
       break;
     case 2:
       if (dlgProgress != null && dlgProgress.isShowing()) {
         dlgProgress.dismiss();
       }
       Toast.makeText(ActRegister.this, strMessage, Toast.LENGTH_LONG).show();
       break;
   }
 }
示例#22
0
 @Override
 protected void onPause() {
   MApplication.getInstance().getmNewsLifecycleHandler().onActivityPaused(this);
   ThirdUtils.statisticsInActivityPause(this);
   if (alertDialog != null && alertDialog.isShowing()) {
     alertDialog.hide();
   }
   if (materialDialog != null && materialDialog.isShowing()) {
     materialDialog.hide();
   }
   PreOnPause();
   super.onPause();
 }
示例#23
0
 protected void showErrorTip(final String errorInfo) {
   if (settingDialog == null || !settingDialog.isShowing()) {
     runOnUiThread(
         new Runnable() {
           @Override
           public void run() {
             Toast toast = Toast.makeText(PortalActivity.this, errorInfo, Toast.LENGTH_LONG);
             toast.setGravity(Gravity.CENTER, 0, -50);
             toast.show();
           }
         });
   }
 }
示例#24
0
 @Override
 protected void onPause() {
   super.onPause();
   String message = "in onPause";
   //        Log.i(TAG, message);
   if (myAlertDialog.isShowing()) {
     myAlertDialog.dismiss();
     isDialogShowing = true;
   } else {
     isDialogShowing = false;
   }
   mySharedPreferencesEditor = mySharedPreferences.edit();
   mySharedPreferencesEditor.putBoolean("isDialogShowing", isDialogShowing);
   mySharedPreferencesEditor.apply();
 }
  @Override
  public void onPause() {
    super.onPause();
    final String methodName = "onPause";
    Alog.d(classTag, methodName);

    // Dismiss in case it's still showing
    AppHelper.dismissProgressDialogForTask(currentAsyncTask);

    if (mConfirmTransactionDialog != null && mConfirmTransactionDialog.getAlert() != null) {
      AlertDialog dialog = mConfirmTransactionDialog.getAlert();
      if (dialog.isShowing()) {
        dialog.dismiss();
      }
    }
  }
 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();
 }
示例#27
0
        @Override
        public void run() {
          if (!alertDialog.isShowing()) return;

          if (alertCountdown == 0) {
            alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setText("Ok");
            alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setVisibility(INVISIBLE);

            alertStatus = ALERTCALL_EXECUTED;

            alertcallExecute();
          } else {
            String message = String.format(alertMessage, alertCountdown);

            alertTextview.setText(message);
            if ((alertCountdown % 5) == 0) Speak.speak(message);

            alertCountdown -= 1;
            handler.postDelayed(alertcallCountdown, 1000);
          }
        }
示例#28
0
文件: Splash.java 项目: daf0x/xbmc
  public void showErrorDialog(Context context, String title, String message) {
    if (myAlertDialog != null && myAlertDialog.isShowing()) return;

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title);
    builder.setIcon(android.R.drawable.ic_dialog_alert);
    builder.setMessage(Html.fromHtml(message));
    builder.setPositiveButton(
        "Exit",
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int arg1) {
            dialog.dismiss();
            finish();
          }
        });
    builder.setCancelable(false);
    myAlertDialog = builder.create();
    myAlertDialog.show();

    // Make links actually clickable
    ((TextView) myAlertDialog.findViewById(android.R.id.message))
        .setMovementMethod(LinkMovementMethod.getInstance());
  }
示例#29
0
  private void showDialog(Context context, String action) {
    if (alertDialog == null) {
      alertDialog =
          new AlertDialog.Builder(context)
              .setTitle("网络异常,请检查网络连接!")
              .setPositiveButton(
                  "确定",
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {}
                  })
              .create();
    }

    if (Config.WWW_ERROR_ACTION.equalsIgnoreCase(action)) {
      alertDialog.setTitle(context.getString(R.string.common_net_error));
    } else if (Config.DISK_NOT_ENOUGH_ACTION.equalsIgnoreCase(action)) {
      alertDialog.setTitle(context.getString(R.string.disk_freespace_not_enough));
    }
    if (!alertDialog.isShowing()) {
      alertDialog.show();
    }
  }
示例#30
0
 private void dismissSendMsgDialog() {
   if (mSendSmsDialog != null && mSendSmsDialog.isShowing()) {
     mSendSmsDialog.dismiss();
   }
   mSendSmsDialog = null;
 }