diff --git a/src/com/owncloud/android/services/FileAlterationMagicListener.java b/src/com/owncloud/android/services/FileAlterationMagicListener.java index ff89a780c8..124e193baf 100644 --- a/src/com/owncloud/android/services/FileAlterationMagicListener.java +++ b/src/com/owncloud/android/services/FileAlterationMagicListener.java @@ -128,6 +128,7 @@ public class FileAlterationMagicListener implements FileAlterationListener { if (fileRunnable.containsKey(file.getAbsolutePath())) { handler.removeCallbacks(fileRunnable.get(file.getAbsolutePath())); handler.postDelayed(fileRunnable.get(file.getAbsolutePath()), 500); + fileRunnable.remove(file.getAbsolutePath()); } } @@ -135,6 +136,7 @@ public class FileAlterationMagicListener implements FileAlterationListener { public void onFileDelete(File file) { if (fileRunnable.containsKey(file.getAbsolutePath())) { handler.removeCallbacks(fileRunnable.get(file.getAbsolutePath())); + fileRunnable.remove(file.getAbsolutePath()); } } diff --git a/src/com/owncloud/android/services/observer/SyncedFolderObserverService.java b/src/com/owncloud/android/services/observer/SyncedFolderObserverService.java index 2c403c4d2a..a496e29f6d 100644 --- a/src/com/owncloud/android/services/observer/SyncedFolderObserverService.java +++ b/src/com/owncloud/android/services/observer/SyncedFolderObserverService.java @@ -138,6 +138,15 @@ public class SyncedFolderObserverService extends Service { } else { for(int i = 0; i < pairArrayList.size(); i++) { SyncedFolder syncFolder = pairArrayList.get(i).getKey(); + for(SyncedFolder syncedFolder : mProvider.getSyncedFolders()) { + if (syncFolder.getId() == syncedFolder.getId()) { + syncFolder = syncedFolder; + pairArrayList.set(i, new SerializablePair(syncFolder, + pairArrayList.get(i).getValue())); + break; + } + } + FileAlterationMagicObserver observer = new FileAlterationMagicObserver(new File( syncFolder.getLocalPath()), fileFilter); observer.setRootEntry(pairArrayList.get(i).getValue());