Is it possible for my app to establish a pendingIntent in my background service and wait for a user action (like modify calendar event) ? And as soon as user adds a calendar event, I want a service/activity to be started ? Can it be done?
Can someone please help me with some backbone code so I can proceed in the right direction ?
Cheers.
For most Android devices, this is not supported. Starting with Android 4.0, it is at least conceivable to write this, by using a
ContentObserveronCalendarContract, but it will be unreliable — yourServicethat is the observer would need to try to run forever, and that does not work. And even this would only work for the AOSP Calendar application — if the user is using another calendar app,CalendarContractmay not be involved.