diff --git a/src/org/thoughtcrime/securesms/PassphraseChangeActivity.java b/src/org/thoughtcrime/securesms/PassphraseChangeActivity.java index eec279fda6..980baabce6 100644 --- a/src/org/thoughtcrime/securesms/PassphraseChangeActivity.java +++ b/src/org/thoughtcrime/securesms/PassphraseChangeActivity.java @@ -16,16 +16,15 @@ */ package org.thoughtcrime.securesms; -import android.os.AsyncTask; import android.content.Context; -import android.util.Log; +import android.os.AsyncTask; import android.os.Bundle; import android.text.Editable; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; -import android.widget.Toast; import org.thoughtcrime.securesms.crypto.InvalidPassphraseException; import org.thoughtcrime.securesms.crypto.MasterSecret; @@ -101,15 +100,13 @@ public class PassphraseChangeActivity extends PassphraseActivity { } if (!passphrase.equals(passphraseRepeat)) { - Toast.makeText(getApplicationContext(), - R.string.PassphraseChangeActivity_passphrases_dont_match_exclamation, - Toast.LENGTH_SHORT).show(); this.newPassphrase.setText(""); this.repeatPassphrase.setText(""); + this.newPassphrase.setError(getString(R.string.PassphraseChangeActivity_passphrases_dont_match_exclamation)); + this.newPassphrase.requestFocus(); } else if (passphrase.equals("")) { - Toast.makeText(getApplicationContext(), - R.string.PassphraseChangeActivity_enter_new_passphrase_exclamation, - Toast.LENGTH_SHORT).show(); + this.newPassphrase.setError(getString(R.string.PassphraseChangeActivity_enter_new_passphrase_exclamation)); + this.newPassphrase.requestFocus(); } else { new ChangePassphraseTask(this).execute(original, passphrase); } @@ -160,9 +157,9 @@ public class PassphraseChangeActivity extends PassphraseActivity { if (masterSecret != null) { setMasterSecret(masterSecret); } else { - Toast.makeText(context, R.string.PassphraseChangeActivity_incorrect_old_passphrase_exclamation, - Toast.LENGTH_LONG).show(); originalPassphrase.setText(""); + originalPassphrase.setError(getString(R.string.PassphraseChangeActivity_incorrect_old_passphrase_exclamation)); + originalPassphrase.requestFocus(); } } }