diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-06 13:36:28 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-06 13:36:28 +0200 |
commit | 9c0ec1f4965bd34a05a7a417df51ca470f5f1fae (patch) | |
tree | e3bb2000e4d6f0d8e5e23cc0ead2f8f6c8defffa /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | 801566bdb11d5edac45680037ada16b51922ba18 (diff) | |
download | open-keychain-9c0ec1f4965bd34a05a7a417df51ca470f5f1fae.tar.gz open-keychain-9c0ec1f4965bd34a05a7a417df51ca470f5f1fae.tar.bz2 open-keychain-9c0ec1f4965bd34a05a7a417df51ca470f5f1fae.zip |
Fix account key selection for API
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-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; } |