aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 18:44:13 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 18:44:13 +0100
commit884aaf7e7ac24a54f54c4e714121869346b7a623 (patch)
treeeda00c934377af20ec192ee4fb02fe8574419c64 /OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents
parenta659e97a645a7874b1712d9ad4e1a7493629ed9b (diff)
downloadopen-keychain-884aaf7e7ac24a54f54c4e714121869346b7a623.tar.gz
open-keychain-884aaf7e7ac24a54f54c4e714121869346b7a623.tar.bz2
open-keychain-884aaf7e7ac24a54f54c4e714121869346b7a623.zip
save selected provider in list preference
Diffstat (limited to 'OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents')
-rw-r--r--OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java
index 987c8c8fc..f1f326fca 100644
--- a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java
+++ b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
+import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.preference.DialogPreference;
import android.util.AttributeSet;
@@ -161,6 +162,16 @@ public class OpenPgpListPreference extends DialogPreference {
return getEntryByValue(mSelectedPackage);
}
+ @Override
+ protected Object onGetDefaultValue(TypedArray a, int index) {
+ return a.getString(index);
+ }
+
+ @Override
+ protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
+ setValue(restoreValue ? getPersistedString(mSelectedPackage) : (String) defaultValue);
+ }
+
public String getEntryByValue(String packageName) {
for (OpenPgpProviderEntry app : mProviderList) {
if (app.packageName.equals(packageName)) {