From b78a564de3d8c3771d2e8ae445e0a43b026531ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Feb 2014 18:59:40 +0100 Subject: [PATCH] temporary fix for nullpointer on orientation change in import activity --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 1 + .../keychain/ui/ImportKeysListFragment.java | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 4102a882e..d970770f5 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -254,6 +254,7 @@ android:label="@string/title_certify_key" /> diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index 68d318491..cfcb202b9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -136,7 +136,7 @@ public class ImportKeysListFragment extends ListFragment implements getLoaderManager().initLoader(LOADER_ID_BYTES, null, this); } - if (mServerQuery != null) { + if (mServerQuery != null && mKeyServer != null) { // Start out with a progress indicator. setListShown(false); @@ -165,14 +165,19 @@ public class ImportKeysListFragment extends ListFragment implements mServerQuery = serverQuery; mKeyServer = keyServer; - // Start out with a progress indicator. - setListShown(false); + if (mKeyBytes != null || mDataUri != null) { + // Start out with a progress indicator. + setListShown(false); - if (mKeyBytes != null || mDataUri != null) getLoaderManager().restartLoader(LOADER_ID_BYTES, null, this); + } + + if (mServerQuery != null && mKeyServer != null) { + // Start out with a progress indicator. + setListShown(false); - if (mServerQuery != null && mKeyServer != null) getLoaderManager().restartLoader(LOADER_ID_SERVER_QUERY, null, this); + } } @Override