Attempt to fix duplicate entries

This commit is contained in:
Mario Danic 2017-02-08 05:55:07 +01:00 committed by AndyScherzinger
parent 7f28c35b34
commit 4068eb5499
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 3 additions and 5 deletions

View file

@ -134,13 +134,11 @@ public class MainApp extends Application {
}
for (Pair<Long, Boolean> pair : syncedFolders.values()) {
if (pair.second) {
ids.add(pair.first);
}
ids.add(pair.first);
}
for (SyncedFolder syncedFolder : syncedFolderList) {
if (ids.contains(syncedFolder.getId())) {
if (!ids.contains(syncedFolder.getId())) {
syncedFolderArrayList.add(syncedFolder);
}
}

View file

@ -193,7 +193,7 @@ public class SyncedFolderProvider extends Observable {
int result = mContentResolver.delete(
ProviderMeta.ProviderTableMeta.CONTENT_URI_SYNCED_FOLDERS,
ProviderMeta.ProviderTableMeta._ID + " IN (?)",
ProviderMeta.ProviderTableMeta._ID + " NOT IN (?)",
new String[]{String.valueOf(ids)}
);