diff options
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java b/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java index 987c8c8fc..f1f326fca 100644 --- a/libraries/keychain-api-library/src/org/openintents/openpgp/util/OpenPgpListPreference.java +++ b/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)) { |