~david-ergo/astrid/removed-attributes-sync-fix

« back to all changes in this revision

Viewing changes to src/com/timsu/astrid/utilities/StartupReceiver.java

  • Committer: Tim Su
  • Date: 2009-12-21 04:25:46 UTC
  • mfrom: (225.1.26 2.10.1)
  • Revision ID: tim@todoroo.com-20091221042546-0v926l6yzpdwrti3
Released 2.10.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
import com.timsu.astrid.R;
13
13
import com.timsu.astrid.activities.SyncPreferences;
 
14
import com.timsu.astrid.appwidget.AstridAppWidgetProvider.UpdateService;
14
15
import com.timsu.astrid.sync.SynchronizationService;
15
16
 
16
17
public class StartupReceiver extends BroadcastReceiver {
58
59
                        }
59
60
                }
60
61
 
61
 
            new Thread(new Runnable() {
62
 
                public void run() {
63
 
                    Notifications.scheduleAllAlarms(context);
64
 
 
65
 
                    // do this after all alarms are scheduled, so if we're
66
 
                    // interrupted, the thread will resume later
67
 
                    Preferences.setCurrentVersion(context, finalVersion);
68
 
                }
69
 
            }).start();
 
62
                Preferences.setCurrentVersion(context, finalVersion);
70
63
        }
71
64
 
 
65
 
 
66
        // schedule alarms in background every time Astrid is run
 
67
        new Thread(new Runnable() {
 
68
            public void run() {
 
69
                Notifications.scheduleAllAlarms(context);
 
70
            }
 
71
        }).start();
 
72
 
72
73
        Preferences.setPreferenceDefaults(context);
73
74
 
74
75
        // start synchronization service
75
76
        SynchronizationService.scheduleService(context);
76
77
 
 
78
        // update widget
 
79
        Intent intent = new Intent(context, UpdateService.class);
 
80
        context.startService(intent);
 
81
 
77
82
        hasStartedUp = true;
78
83
    }
79
84
}