Fix NPE
This commit is contained in:
parent
ee2efd1291
commit
d21179a66d
1 changed files with 11 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue