FileDocCategorySizeDatePackage
CalendarReceiver.javaAPI DocAndroid 1.5 API1981Wed May 06 22:42:48 BST 2009com.android.providers.calendar

CalendarReceiver

public class CalendarReceiver extends android.content.BroadcastReceiver
This IntentReceiver executes when the boot completes and ensures that the Calendar provider has started and then initializes the alarm scheduler for the Calendar provider. This needs to be done after the boot completes because the alarm manager may not have been started yet.

Fields Summary
static final String
SCHEDULE
Constructors Summary
Methods Summary
public voidonReceive(android.content.Context context, android.content.Intent intent)


    
          
        String action = intent.getAction();
        ContentResolver cr = context.getContentResolver();
        CalendarProvider provider;
        IContentProvider icp = cr.acquireProvider("calendar");
        provider = (CalendarProvider) ContentProvider.
                coerceToLocalContentProvider(icp);
        if (action.equals(SCHEDULE)) {
            provider.scheduleNextAlarm(false /* do not remove alarms */);
        } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
            provider.bootCompleted();
        }
        cr.releaseProvider(icp);