diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java index 22a69e99ab..7f68890279 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java @@ -154,12 +154,14 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity { filterText.setText(filter); } } + List list = new ArrayList(); if (downloadListIndexThread.getCachedIndexFiles() != null && downloadListIndexThread.isDownloadedFromInternet()) { - DownloadIndexAdapter adapter = new DownloadIndexAdapter(this, getFilteredByType()); - setListAdapter(adapter); + list = getFilteredByType(); } else { downloadIndexList(); } + DownloadIndexAdapter adapter = new DownloadIndexAdapter(this, list); + setListAdapter(adapter); if(getMyApplication().getResourceManager().getIndexFileNames().isEmpty()) { boolean showedDialog = SuggestExternalDirectoryDialog.showDialog(this, null, null); if(!showedDialog) { @@ -219,9 +221,6 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity { } ((DownloadIndexAdapter) getExpandableListAdapter()).notifyDataSetInvalidated(); } - if(getExpandableListAdapter() != null) { - ((DownloadIndexAdapter)getExpandableListAdapter()).updateLoadedFiles(); - } } private void downloadIndexList() {