diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java index 746329e08..c357e2556 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java @@ -6,13 +6,10 @@ import android.preference.Preference; import com.timsu.astrid.R; import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.ContextManager; import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; import com.todoroo.astrid.actfm.sync.ActFmSyncV2Provider; -import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.sync.SyncProviderPreferences; import com.todoroo.astrid.sync.SyncProviderUtilities; -import com.todoroo.astrid.sync.SyncResultCallbackAdapter; /** * Displays synchronization preferences and an action panel so users can @@ -36,12 +33,7 @@ public class ActFmPreferences extends SyncProviderPreferences { Intent intent = new Intent(this, ActFmLoginActivity.class); startActivityForResult(intent, REQUEST_LOGIN); } else { - new ActFmSyncV2Provider().synchronizeActiveTasks(true, new SyncResultCallbackAdapter() { - @Override - public void finished() { - ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); - } - }); + setResult(RESULT_CODE_SYNCHRONIZE); finish(); } } diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java index 774b5d73f..c0ddece42 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java @@ -5,14 +5,11 @@ import android.os.Bundle; import com.timsu.astrid.R; import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity; import com.todoroo.astrid.gtasks.sync.GtasksSyncV2Provider; import com.todoroo.astrid.sync.SyncProviderPreferences; import com.todoroo.astrid.sync.SyncProviderUtilities; -import com.todoroo.astrid.sync.SyncResultCallbackAdapter; /** * Displays synchronization preferences and an action panel so users can @@ -46,12 +43,7 @@ public class GtasksPreferences extends SyncProviderPreferences { Intent intent = new Intent(this, GtasksLoginActivity.class); startActivityForResult(intent, REQUEST_LOGIN); } else { - new GtasksSyncV2Provider().synchronizeActiveTasks(true, new SyncResultCallbackAdapter() { - @Override - public void finished() { - ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); - } - }); + setResult(RESULT_CODE_SYNCHRONIZE); finish(); } }