I have got some times stored in ISO format. Some of these times are flagged to either 1(on) or 0(off) set in another column. I need to set a reminder at the times flagged to 1, but how would I pass that each date to the reminder class?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is no public API for the Alarm Clock application.
There is no public API for the Calendar application, though since it is a native UI for a Google Calendar, you could push an event over to the Google Calendar via its GData API.
回答2:
ContentValues reminderContentValues = new ContentValues();
reminderContentValues.put(FIELD_REMINDER_EVENT_ID, eventId);
reminderContentValues.put(FIELD_REMINDER_METHOD, 1);
reminderContentValues.put(FIELD_REMINDER_MIN, minutesBefore);
mContext.getContentResolver().insert(getRemindersUri(), reminderContentValues);