Example usage for android.widget EditText equals

List of usage examples for android.widget EditText equals

Introduction

In this page you can find the example usage for android.widget EditText equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:Main.java

public static boolean isMyphone(Context context, EditText myPhone) {
    TelephonyManager phoneMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    String number = phoneMgr.getLine1Number();
    if (myPhone.equals(number)) {
        return true;
    } else {/*from   w ww .  j  a  va  2  s .co m*/
        return false;
    }
}

From source file:com.doplgangr.secrecy.views.VaultsListFragment.java

void add() {
    final View dialogView = View.inflate(context, R.layout.new_credentials, null);
    final EditText password = new EditText(context);
    password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
    new AlertDialog.Builder(context).setTitle(getString(R.string.Vault__new)).setView(dialogView)
            .setPositiveButton(getString(R.string.OK), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    String name = ((EditText) dialogView.findViewById(R.id.newName)).getText().toString();
                    String password = ((EditText) dialogView.findViewById(R.id.stealth_keycode)).getText()
                            .toString();
                    String Confirmpassword = ((EditText) dialogView.findViewById(R.id.confirmPassword))
                            .getText().toString();
                    File directory = new File(Storage.getRoot().getAbsolutePath() + "/" + name);
                    if (!password.equals(Confirmpassword) || "".equals(password))
                        passwordWrong();
                    else if (directory.mkdirs()) {
                        // Create vault to initialize the vault header
                        ProgressDialog progress = new ProgressDialog(context);
                        progress.setIndeterminate(true);
                        progress.setMessage(getString(R.string.Vault__initializing));
                        progress.setCancelable(false);
                        progress.show();
                        createVaultInBackground(name, password, directory, dialog, progress);
                    } else
                        failedtocreate();

                }/*from  w  w  w .  ja  va  2 s  .  co  m*/
            }).setNegativeButton(getString(R.string.CANCEL), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    // Do nothing.
                }
            }).show();
}