0

I have a service that fires off every 5 minutes or so... How would i query android to see when this service is scheduled to go off programatically?

    <!-- Send Census Service -->
    <service android:name="services.scheduled.SendCensusScheduledService"
             android:icon="@drawable/ic_launcher"
             android:label="SyncServerDataScheduledService" />
    <receiver android:name="services.receivers.SendCensusScheduledServiceReceiver" >
        <intent-filter>
            <action android:name="ReceiptBucketClient.android.action.broadcast"/>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>
    <receiver android:name="services.receivers.StartSendCensusScheduledServiceReceiver" />
Chris Legge
  • 739
  • 2
  • 9
  • 24

1 Answers1

0

Check by the PendingIntent:

PendingIntent intent = PendingIntent.getBroadcast(context, 0, 
        new Intent("ReceiptBucketClient.android.action.broadcast"), 
        PendingIntent.FLAG_NO_CREATE;

if (intent != null) {
   // you have the service scheduled. Cancel it!
   intent.cancel();
}

Remember that only the original application owning a PendingIntent can cancel it.

Deividi Cavarzan
  • 10,034
  • 13
  • 66
  • 80