Fix crash while map downloading

This commit is contained in:
Alexey Kulish 2016-11-18 15:43:00 +03:00
parent 12403b4306
commit 8b39eebb77
2 changed files with 6 additions and 7 deletions

View file

@ -60,8 +60,7 @@ public class LocalIndexInfo {
}
// Special domain object represents category
public LocalIndexInfo(@NonNull LocalIndexType type, boolean backup, @NonNull String subfolder,
@NonNull OsmandApplication app) {
public LocalIndexInfo(@NonNull LocalIndexType type, boolean backup, @NonNull String subfolder) {
this.type = type;
backupedData = backup;
this.subfolder = subfolder;

View file

@ -342,7 +342,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
@Override
public void loadFile(LocalIndexInfo... loaded) {
publishProgress(loaded);
if (!isCancelled()) {
publishProgress(loaded);
}
}
@Override
@ -853,8 +855,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
return i;
}
}
LocalIndexInfo newCat = new LocalIndexInfo(val.getType(), backuped, val.getSubfolder(),
getMyApplication());
LocalIndexInfo newCat = new LocalIndexInfo(val.getType(), backuped, val.getSubfolder());
category.add(newCat);
data.put(newCat, new ArrayList<LocalIndexInfo>());
return newCat;
@ -931,8 +932,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
}
if (found == -1) {
found = category.size();
category.add(new LocalIndexInfo(info.getType(), info.isBackupedData(),
info.getSubfolder(), getMyApplication()));
category.add(new LocalIndexInfo(info.getType(), info.isBackupedData(), info.getSubfolder()));
}
if (!data.containsKey(category.get(found))) {
data.put(category.get(found), new ArrayList<LocalIndexInfo>());