From 8f4bf417814f923a5377ca1169bc743b8a32f6ed Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 20 Oct 2015 16:20:13 +0300 Subject: [PATCH] Fix empty downloads list --- .../osmand/plus/download/DownloadIndexesThread.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 2e143083b3..2846643366 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -250,9 +250,15 @@ public class DownloadIndexesThread { DownloadResources result = new DownloadResources(app); DownloadOsmandIndexesHelper.IndexFileList indexFileList = DownloadOsmandIndexesHelper.getIndexesList(ctx); if (indexFileList != null) { - result.isDownloadedFromInternet = indexFileList.isDownloadedFromInternet(); - result.mapVersionIsIncreased = indexFileList.isIncreasedMapVersion(); - result.prepareData(indexFileList.getIndexFiles()); + try { + while (app.isApplicationInitializing()) { + Thread.sleep(200); + } + result.isDownloadedFromInternet = indexFileList.isDownloadedFromInternet(); + result.mapVersionIsIncreased = indexFileList.isIncreasedMapVersion(); + result.prepareData(indexFileList.getIndexFiles()); + } catch (Exception e) { + } } return result; }