diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/pwgen/pw_rand.java | 3 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/pwgen/pw_rand.java b/app/src/main/java/com/zeapo/pwdstore/pwgen/pw_rand.java index 1f4acdec..945aaf71 100644 --- a/app/src/main/java/com/zeapo/pwdstore/pwgen/pw_rand.java +++ b/app/src/main/java/com/zeapo/pwdstore/pwgen/pw_rand.java @@ -19,7 +19,7 @@ public class pw_rand { * @return the generated password */ public static String rand(int size, int pwFlags) { - String password = ""; + String password; char cha; int i, featureFlags, num; String val; @@ -36,6 +36,7 @@ public class pw_rand { bank += pwgen.SYMBOLS_STR; } do { + password = ""; featureFlags = pwFlags; i = 0; while (i < size) { diff --git a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java index 019396db..7d798a81 100644 --- a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java @@ -61,13 +61,13 @@ public class pwgenDialogFragment extends DialogFragment { TextView textView = (TextView) view.findViewById(R.id.lengthNumber); textView.setText(Integer.toString(prefs.getInt("length", 20))); - ((EditText) view.findViewById(R.id.passwordText)).setTypeface(monoTypeface); + ((TextView) view.findViewById(R.id.passwordText)).setTypeface(monoTypeface); builder.setPositiveButton(getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { EditText edit = (EditText) callingActivity.findViewById(R.id.crypto_password_edit); - EditText generate = (EditText) view.findViewById(R.id.passwordText); + TextView generate = (TextView) view.findViewById(R.id.passwordText); edit.append(generate.getText()); } }); @@ -86,16 +86,16 @@ public class pwgenDialogFragment extends DialogFragment { @Override public void onShow(DialogInterface dialog) { setPreferences(); - EditText editText = (EditText) view.findViewById(R.id.passwordText); - editText.setText(pwgen.generate(getActivity().getApplicationContext()).get(0)); + TextView textView = (TextView) view.findViewById(R.id.passwordText); + textView.setText(pwgen.generate(getActivity().getApplicationContext()).get(0)); Button b = ad.getButton(AlertDialog.BUTTON_NEUTRAL); b.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setPreferences(); - EditText editText = (EditText) view.findViewById(R.id.passwordText); - editText.setText(pwgen.generate(callingActivity.getApplicationContext()).get(0)); + TextView textView = (TextView) view.findViewById(R.id.passwordText); + textView.setText(pwgen.generate(callingActivity.getApplicationContext()).get(0)); } }); } |