Вопрос

I an newbie to android development so there is a huge possibility that I am asking a question that is very basic, but I am struggling to find an answer. I am writing a mobile app, that will fetch the calendar events for a particular day from the calendar app in Nexus 7. For those events which requires joining a call, the user will be able to update the event with the phone numbers require for the call. I am able to implement to the part where I am fetching details from the calendar and user updating the call details. On save, I am saving the event and the phone number in my app's database.

Now what I need, is at the time of the event, I should be able to use the calendar notification, to call a function of my app and display the call details to the user. I have written the following broadcast receiver to accept the alarm.

public class GetCalendarNotification extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

    IntentFilter filter = new IntentFilter(CalendarContract.ACTION_EVENT_REMINDER);
    filter.addDataScheme("content");   



}

I though I can use Intent.getData() to get the event details and then query my app database with the event details and provide the details to the users. The Intent.getData() returned content://com.android.calendar/1383739860000, which I am not sure what it is. Is there anyway to fetch the calendar event name, start date and time from content://com.android.calendar/1383739860000?

Regards Debdeep

Это было полезно?

Решение

I could resolve it myself. I used Alarmanager and intent to schedule the task and later at the time of event, I read from the extra for the details.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top