Skip to content

Commit

Permalink
avoid ConcurrentModificationException
Browse files Browse the repository at this point in the history
  • Loading branch information
segler-alex committed Aug 18, 2019
1 parent 61e6f5f commit 3b5b677
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
minSdkVersion 15
targetSdkVersion 28

versionCode 88
versionName "0.78"
versionCode 89
versionName "0.79"

multiDexEnabled true
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ void refreshStationsFromServer() {
new AsyncTask<Void, Void, Integer>() {
@Override
protected Integer doInBackground(Void... params) {
int deletedCount = 0;
ArrayList<DataRadioStation> stationsToRemove = new ArrayList<DataRadioStation>();
for (DataRadioStation station : listStations) {
if (!station.refresh(httpClient, context) && !station.hasValidUuid() && station.RefreshRetryCount > DataRadioStation.MAX_REFRESH_RETRIES) {
listStations.remove(station);
deletedCount++;
stationsToRemove.add(station);
}
}
return deletedCount;
listStations.removeAll(stationsToRemove);
return stationsToRemove.size();
}

@Override
Expand Down

0 comments on commit 3b5b677

Please sign in to comment.