From 28ba83372ca49c8ce38aceb59877fc67a663d792 Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 9 Nov 2014 17:19:07 +0100 Subject: if the timer is empty default to 45sec --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index 97856fd2..ce0ff9b6 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -149,9 +149,16 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", ((TextView) findViewById(R.id.crypto_password_show)).getText()); clipboard.setPrimaryClip(clip); - showToast(this.getResources().getString(R.string.clipboard_beginning_toast_text) - + Integer.parseInt(settings.getString("general_show_time", "45")) - + this.getResources().getString(R.string.clipboard_ending_toast_text)); + try { + showToast(this.getResources().getString(R.string.clipboard_beginning_toast_text) + + Integer.parseInt(settings.getString("general_show_time", "45")) + + this.getResources().getString(R.string.clipboard_ending_toast_text)); + } catch (NumberFormatException e) + { + showToast(this.getResources().getString(R.string.clipboard_beginning_toast_text) + + "45" + + this.getResources().getString(R.string.clipboard_ending_toast_text)); + } } public void handleClick(View view) { -- cgit v1.2.3