Fix crash while map downloading
This commit is contained in:
parent
12403b4306
commit
8b39eebb77
2 changed files with 6 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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>());
|
||||
|
|
Loading…
Reference in a new issue