Fix for AST-240 - random force closes while using other applications (background sync NPE)

pull/14/head
Tim Su 14 years ago
parent 03c83324a7
commit 61f014358b

@ -11,6 +11,7 @@ import android.util.Log;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.producteev.sync.ProducteevSyncProvider;
import com.todoroo.astrid.utility.Preferences;
@ -35,8 +36,11 @@ public class ProducteevBackgroundService extends Service {
/** Receive the alarm - start the synchronize service! */
@Override
public void onStart(Intent intent, int startId) {
if(intent != null && SYNC_ACTION.equals(intent.getAction()))
try {
startSynchronization(this);
} catch (Exception e) {
PluginServices.getExceptionService().reportError("pdv-bg-sync", e); //$NON-NLS-1$
}
}
/** Start the actual synchronization */

@ -11,6 +11,7 @@ import android.util.Log;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.rmilk.sync.RTMSyncProvider;
import com.todoroo.astrid.utility.Preferences;
@ -35,8 +36,11 @@ public class MilkBackgroundService extends Service {
/** Receive the alarm - start the synchronize service! */
@Override
public void onStart(Intent intent, int startId) {
if(SYNC_ACTION.equals(intent.getAction()))
try {
startSynchronization(this);
} catch (Exception e) {
PluginServices.getExceptionService().reportError("rtm-bg-sync", e); //$NON-NLS-1$
}
}
/** Start the actual synchronization */

Loading…
Cancel
Save