diff options
author | bcbarnes-gmx <bcbarnes@gmx.com> | 2013-07-22 09:59:14 -0500 |
---|---|---|
committer | bcbarnes-gmx <bcbarnes@gmx.com> | 2013-07-22 09:59:14 -0500 |
commit | 27bf2a57710edc559afe653ea6e04339aad1fb7b (patch) | |
tree | f1224387e581d2d59c4ef9ea602188e3309e097d /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget | |
parent | 28b3c20b15b14d068b72cee961829ac1ade8d90a (diff) | |
download | open-keychain-27bf2a57710edc559afe653ea6e04339aad1fb7b.tar.gz open-keychain-27bf2a57710edc559afe653ea6e04339aad1fb7b.tar.bz2 open-keychain-27bf2a57710edc559afe653ea6e04339aad1fb7b.zip |
Issues #41 and #43
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget')
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index e9a5674cd..45c106eb9 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -59,10 +59,14 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { Button mExpiryDateButton; GregorianCalendar mExpiryDate; + private int mDatePickerResultCount = 0; private DatePickerDialog.OnDateSetListener mExpiryDateSetListener = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { - GregorianCalendar date = new GregorianCalendar(year, monthOfYear, dayOfMonth); - setExpiryDate(date); + if(mDatePickerResultCount++ == 0) // Note: Ignore results after the first one - android sends multiples. + { + GregorianCalendar date = new GregorianCalendar(year, monthOfYear, dayOfMonth); + setExpiryDate(date); + } } }; @@ -111,11 +115,15 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { DatePickerDialog dialog = new DatePickerDialog(getContext(), mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH), date.get(Calendar.DAY_OF_MONTH)); + mDatePickerResultCount = 0; dialog.setCancelable(true); dialog.setButton(Dialog.BUTTON_NEGATIVE, getContext() .getString(R.string.btn_noDate), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - setExpiryDate(null); + if(mDatePickerResultCount++ == 0) // Note: Ignore results after the first one - android sends multiples. + { + setExpiryDate(null); + } } }); dialog.show(); |