diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java | 2 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java index 000e08e7..c12b2298 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java +++ b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java @@ -123,7 +123,7 @@ public class SshKeyGen extends AppCompatActivity { b.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - TextView textView = (TextView) getDialog().findViewById(R.id.public_key); + TextView textView = (TextView) v.findViewById(R.id.public_key); ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText("public key", textView.getText().toString()); clipboard.setPrimaryClip(clip); diff --git a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java index 1a42e2ba..019396db 100644 --- a/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/pwgenDialogFragment.java @@ -86,16 +86,16 @@ public class pwgenDialogFragment extends DialogFragment { @Override public void onShow(DialogInterface dialog) { setPreferences(); - EditText textView = (EditText) view.findViewById(R.id.passwordText); - textView.setText(pwgen.generate(getActivity().getApplicationContext()).get(0)); + EditText editText = (EditText) view.findViewById(R.id.passwordText); + editText.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 textView = (EditText) getDialog().findViewById(R.id.passwordText); - textView.setText(pwgen.generate(getActivity().getApplicationContext()).get(0)); + EditText editText = (EditText) view.findViewById(R.id.passwordText); + editText.setText(pwgen.generate(callingActivity.getApplicationContext()).get(0)); } }); } @@ -120,9 +120,9 @@ public class pwgenDialogFragment extends DialogFragment { if (!((CheckBox) getDialog().findViewById(R.id.pronounceable)).isChecked()) { preferences.add("s"); } - EditText textView = (EditText) getDialog().findViewById(R.id.lengthNumber); + EditText editText = (EditText) getDialog().findViewById(R.id.lengthNumber); try { - int length = Integer.valueOf(textView.getText().toString()); + int length = Integer.valueOf(editText.getText().toString()); return pwgen.setPrefs(getActivity().getApplicationContext(), preferences, length); } catch(NumberFormatException e) { return pwgen.setPrefs(getActivity().getApplicationContext(), preferences); |