From f6e7b92ced34bad78f47820f35df750c65a386ab Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 17 Apr 2014 15:50:16 +0200 Subject: [PATCH] load data only once in ImportKeysListLoader Fixes #571 --- .../keychain/ui/adapter/ImportKeysListLoader.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java index f476382f4..e7a045294 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java @@ -51,9 +51,8 @@ public class ImportKeysListLoader } } - Context mContext; - - InputData mInputData; + final Context mContext; + final InputData mInputData; ArrayList mData = new ArrayList(); AsyncTaskResultWrapper> mEntryListWrapper; @@ -67,6 +66,11 @@ public class ImportKeysListLoader @Override public AsyncTaskResultWrapper> loadInBackground() { + // This has already been loaded! nvm any further, just return + if (mEntryListWrapper != null) { + return mEntryListWrapper; + } + mEntryListWrapper = new AsyncTaskResultWrapper>(mData, null); if (mInputData == null) {