From d21179a66d3ee6a51828c74ccfcc36c4f48c261a Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 5 Nov 2014 22:01:27 +0100 Subject: [PATCH] Fix NPE --- .../plus/download/DownloadActivity.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 1f4e152c22..ac08076ea8 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -71,6 +71,16 @@ public class DownloadActivity extends SherlockFragmentActivity { setProgressBarIndeterminateVisibility(false); setContentView(R.layout.tab_content); + if(downloadListIndexThread == null) { + downloadListIndexThread = new DownloadIndexesThread(this); + } + if (downloadListIndexThread.getCachedIndexFiles() != null && downloadListIndexThread.isDownloadedFromInternet()) { + downloadListIndexThread.runCategorization(type); + } else { + downloadListIndexThread.runReloadIndexFiles(); + } + downloadListIndexThread.setUiActivity(this); + settings = ((OsmandApplication) getApplication()).getSettings(); tabHost = (TabHost) findViewById(android.R.id.tabhost); tabHost.setup(); @@ -90,16 +100,7 @@ public class DownloadActivity extends SherlockFragmentActivity { tabHost.setCurrentTab(0); - if(downloadListIndexThread == null) { - downloadListIndexThread = new DownloadIndexesThread(this); - } - if (downloadListIndexThread.getCachedIndexFiles() != null && downloadListIndexThread.isDownloadedFromInternet()) { - downloadListIndexThread.runCategorization(type); - } else { - downloadListIndexThread.runReloadIndexFiles(); - } - downloadListIndexThread.setUiActivity(this); - + settings = ((OsmandApplication)getApplication()).getSettings(); indeterminateProgressBar = (ProgressBar) findViewById(R.id.IndeterminateProgressBar);