How to set android reminder/alarm?

孤者浪人 提交于 2019-12-25 02:44:29

问题


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);


来源:https://stackoverflow.com/questions/2189244/how-to-set-android-reminder-alarm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!