From: Bartek Przybylski Date: Wed, 22 Aug 2012 19:20:38 +0000 (+0200) Subject: proper reinitialize of service X-Git-Tag: oc-android-1.4.3~193 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/b2a260286e1dcc5301264087cb699b9741957b80 proper reinitialize of service --- diff --git a/src/com/owncloud/android/files/services/FileObserverService.java b/src/com/owncloud/android/files/services/FileObserverService.java index a8fb7025..4d6dd027 100644 --- a/src/com/owncloud/android/files/services/FileObserverService.java +++ b/src/com/owncloud/android/files/services/FileObserverService.java @@ -48,6 +48,13 @@ public class FileObserverService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { + // this occurs when system tries to restart + // service, so we need to reinitialize observers + if (intent == null) { + initializeObservedList(); + return Service.START_STICKY; + } + if (!intent.hasExtra(KEY_FILE_CMD)) { Log.e(TAG, "No KEY_FILE_CMD argument given"); return Service.START_STICKY;