From 8a3f6a28a724d09e203c7a3655418d00eb5e5dc0 Mon Sep 17 00:00:00 2001 From: Jonas Kalderstam Date: Fri, 7 Apr 2017 22:34:57 +0200 Subject: [PATCH] Destroy Loader after finish to avoid clearing selections Fixes #135 --- .../nononsenseapps/filepicker/AbstractFilePickerFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java index 2f3e51f6..3597e0e6 100644 --- a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java +++ b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java @@ -583,6 +583,8 @@ public void onLoadFinished(final Loader> loader, if (mCurrentDirView != null) { mCurrentDirView.setText(getFullPath(mCurrentPath)); } + // Stop loading now to avoid a refresh clearing the user's selections + getLoaderManager().destroyLoader( 0 ); } /** @@ -595,8 +597,6 @@ public void onLoadFinished(final Loader> loader, @Override public void onLoaderReset(final Loader> loader) { isLoading = false; - mAdapter.setList(null); - mFiles = null; } /**