示例#1
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.social_imgbtn_facebook:
        selectColor();
        break;
      case R.id.social_imgbtn_twitter:
        selectColor();
        break;
      case R.id.calls_imgbtn_calls:
        selectColor();
        break;

      case R.id.social_alert_color_1:
        Toast.makeText(getActivity(), "color uno elegido", Toast.LENGTH_SHORT).show();
        show.dismiss();
        break;
      case R.id.social_alert_color_2:
        Toast.makeText(getActivity(), "color dos elegido", Toast.LENGTH_SHORT).show();
        show.dismiss();
        break;
      case R.id.social_alert_color_3:
        Toast.makeText(getActivity(), "color tres elegido", Toast.LENGTH_SHORT).show();
        show.dismiss();
        break;
      case R.id.social_alert_color_4:
        Toast.makeText(getActivity(), "color cuatro elegido", Toast.LENGTH_SHORT).show();
        show.dismiss();
        break;
      default:
        break;
    }
  }
示例#2
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;
   }
 }
示例#3
0
  @Override
  public void onClick(View v) {
    Boolean wantToCloseDialog = true;
    switch (v.getId()) {
      case R.id.btn_yes:
        if (exerciseName.getText().toString().compareTo("") != 0) {
          db.Open();
          db.UpdateExercise(
              exerciseName.getText().toString(),
              ((ExerciseType) exerciseType.getSelectedItem()).Id,
              exerciseId);
          db.Close();
        } else {
          wantToCloseDialog = false;
        }

        if (wantToCloseDialog) {
          parent.OnUpdated(
              new ExerciseDto(
                  exerciseId,
                  exerciseName.getText().toString(),
                  ((ExerciseType) exerciseType.getSelectedItem()).Id));
          alertDialog.dismiss();
        }
        break;
      case R.id.btn_no:
        alertDialog.dismiss();
        break;
    }
  }
  @Override
  public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {

    if (arg0.getId() == R.id.listView1) {
      Log.d("listview", "position" + position);

      switch (position) {
        case 0:
          alertDialog.dismiss();
          prompt();

          break;

        case 1:
          Bundle basket = new Bundle();
          basket.putInt("position", pos);
          basket.putSerializable("abolist", abolist);
          Intent i = new Intent(ProviderList.this, EditBundle.class);
          i.putExtras(basket);
          startActivity(i);

          break;

        case 2:
          alertDialog.dismiss();
          new delete().execute();

          break;

        case 3:
          String provider = abolist.get(pos).getProvider();
          Log.d("basket", provider);
          Bundle b = new Bundle();
          b.putString("provider", provider);
          Intent intent = new Intent(ProviderList.this, Insert.class);
          intent.putExtras(b);
          startActivity(intent);
      }

    } else {
      Bundle basket = new Bundle();
      basket.putInt("position", position);
      basket.putSerializable("abolist", abolist);
      Intent i = new Intent(ProviderList.this, EditBundle.class);
      i.putExtras(basket);
      startActivity(i);
    }
  }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   if (mDialog != null) {
     mDialog.dismiss();
   }
 }
  @Override
  public void onPause() {
    super.onPause();
    Log.d(TAG, "onPause()");

    if (alertDialog != null) alertDialog.dismiss();
  }
 public void handleMessage(Message msg) {
   if (msg.what == MESSAGE_DISMISS) {
     if (mDialog != null) {
       mDialog.dismiss();
     }
   }
 }
  @Override
  public void onPause() {
    super.onPause();
    MyAccessibilityService talkBackService = MyAccessibilityService.getInstance();
    if (talkBackService != null && talkBackService.supportsTouchScreen()) {
      getContentResolver().unregisterContentObserver(mTouchExploreObserver);
    }

    if (mExploreByTouchDialog != null) {
      mExploreByTouchDialog.dismiss();
    }

    if (mTreeDebugDialog != null) {
      mTreeDebugDialog.dismiss();
    }
  }
  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();
  }
示例#10
0
  private void sendSMSMessage(final Contact contact) {
    PendingIntent sentPI = PendingIntent.getBroadcast(getActivity(), 0, new Intent("SMS_SENT"), 0);

    getActivity()
        .registerReceiver(
            new BroadcastReceiver() {
              @Override
              public void onReceive(Context context, Intent intent) {
                if (intent.getAction().equals("SMS_SENT")) {
                  Toast.makeText(getContext(), "Message sent", Toast.LENGTH_SHORT).show();
                } else {
                  Toast.makeText(getContext(), "Error sending message", Toast.LENGTH_SHORT).show();
                }
                if (getResultCode() == Activity.RESULT_OK) {
                  adapter.update(contact);
                }
              }
            },
            new IntentFilter("SMS_SENT"));

    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage(contact.number, null, dialogMessage.getText().toString(), sentPI, null);

    dialog.dismiss();
  }
 @Override
 public void onPause() {
   super.onPause();
   if (alertDialog != null) {
     alertDialog.dismiss();
   }
 }
 @Override
 public void onPause() {
   super.onPause();
   if (deleteConfirmationDialog != null) {
     deleteConfirmationDialog.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();
   }
 }
 protected void onStorageReady() {
   if (mAlertDialog != null) {
     mAlertDialog.dismiss();
     mAlertDialog = null;
     unregisterReceiver(mMountReceiver);
   }
 }
 @Override
 protected void onPause() {
   super.onPause();
   if (mAlertDialog != null && mAlertDialog.isShowing()) {
     mAlertDialog.dismiss();
   }
 }
示例#17
0
 @Override
 public void onStop() {
   super.onStop();
   if (mClearSearchHistoryDialog != null && mClearSearchHistoryDialog.isShowing()) {
     mClearSearchHistoryDialog.dismiss();
   }
 }
示例#18
0
 public void browse(View view) {
   Intent pickPhoto =
       new Intent(
           Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
   startActivityForResult(pickPhoto, BROWSE_IMAGE_REQUEST);
   alertDialog.dismiss();
 }
示例#19
0
 @Override
 protected void onDestroy() {
   if (alertDialog != null) {
     alertDialog.dismiss();
   }
   super.onDestroy();
 }
 public void dismissPendingDialogs() {
   if (mDialog != null) {
     mDialog.dismiss();
     mDialog = null;
   }
   mAnswerFragment.dismissPendingDialogues();
 }
 @Override
 protected void onPause() {
   Log.i(t, "onPause: Pausing upload of " + mInstancesToSend.length + " instances!");
   super.onPause();
   if (mAlertDialog != null && mAlertDialog.isShowing()) {
     mAlertDialog.dismiss();
   }
 }
示例#22
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;
   }
 }
 @Override
 protected void onPause() {
   super.onPause();
   if (dialog != null) {
     dialog.dismiss();
     dialog = null;
   }
 }
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    operatorText.setText(lists.get(position));
    expandFocusResultChange(generateText());
    // value = generateValue();
    alertDialog.dismiss();
  }
示例#25
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
   if (mDialog != null) {
     mDialog.dismiss();
   }
 }
 @Override
 public void onStop() {
   super.onStop();
   if (mResetDialog != null) {
     mResetDialog.dismiss();
     mResetDialog = null;
   }
 }
示例#27
0
  @Override
  protected void onPause() {
    super.onPause();

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

    saveComplexPreferences();
  }
 @Override
 public void onPause() {
   if (mTranslationDialog != null) {
     mTranslationDialog.dismiss();
     mTranslationDialog = null;
   }
   super.onPause();
 }
 @Override
 public void onClick(View v) {
   ShootEvent shootEvent = (ShootEvent) v.getTag();
   shootEvent.append(mReboundEvent);
   mActivity.addNewEvent(shootEvent);
   checkReboundEvent(mReboundEvent);
   mDialog.dismiss();
 }
 private void dismissProgressDialog() {
   if (!isMakeMeRequestStarted && !isStatusesRequestStarted) {
     if (mProgressDialog != null) {
       mProgressDialog.dismiss();
       mProgressDialog = null;
     }
   }
 }