diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java index 5050c01af..c2414e86d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java @@ -84,7 +84,8 @@ public abstract class KeySpinner extends AppCompatSpinner implements @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (mListener != null) { - mListener.onKeyChanged(id); + long keyId = getSelectedKeyId(getItemAtPosition(position)); + mListener.onKeyChanged(keyId); } } @@ -137,6 +138,10 @@ public abstract class KeySpinner extends AppCompatSpinner implements public long getSelectedKeyId() { Object item = getSelectedItem(); + return getSelectedKeyId(item); + } + + public long getSelectedKeyId(Object item) { if (item instanceof KeyItem) { return ((KeyItem) item).mKeyId; } |