>活动说明
>活动地点
>从日期,到目前为止
>全天活动/没有
>重复/重复信息
我无法填充“提醒”部分,我想填写提醒部分.很高兴能得到一些帮助
这是我用来打开日历应用程序和填充日期的代码.
// Intent to open Calendar EventIntent intent = new Intent(Intent.ACTION_INSERT) .setData(Events.CONTENT_URI);intent.putExtra(Events.DESCRIPTION,desc);intent.putExtra(Events.EVENT_LOCATION,location);intent.putExtra(Events.Title,summary);intent.putExtra(Events.EVENT_TIMEZONE,beginTime.getTimeZone().getID());intent.putExtra(Events.STATUS,statusstr);intent.putExtra(Events.VISIBLE,transparency);intent.putExtra(Events.RRulE,"FREQ=YEARLY;INTERVAL=1;BYYEARDAY=1,2;UNTIL=20161210;");intent.putExtra(Events.EXDATE,androIDExDateStr.toString());// Not sure on how to use CalendarContract.Reminders,TrIEd the following but does not seem to be workingintent.putExtra(CalendarContract.Reminders.DESCRIPTION,desc);intent.putExtra(CalendarContract.Reminders.EVENT_LOCATION,location);intent.putExtra(CalendarContract.Reminders.Title,summary);intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,beginTime.getTimeInMillis());intent.putExtra(CalendarContract.Reminders.DTSTART,beginTime.getTimeInMillis());intent.putExtra(CalendarContract.Reminders.EVENT_TIMEZONE,beginTime.getTimeZone().getID());intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,endTime.getTimeInMillis());intent.putExtra(CalendarContract.Reminders.DTEND,endTime.getTimeInMillis());intent.putExtra(CalendarContract.Reminders.STATUS,statusstr);intent.putExtra(CalendarContract.Reminders.RRulE,2;UNTIL=20161210;");intent.putExtra(CalendarContract.Reminders.EXDATE,androIDExDateStr.toString());//intent.putExtra(CalendarContract.Reminders.METHOD,Reminders.METHOD_EMAIL);//intent.putExtra(CalendarContract.Reminders.MINUTES,reminderVal) ;//intent.putExtra(CalendarContract.Events.HAS_ALARM,1);//} try { context.startActivity(intent);} catch(Exception e) { e.printstacktrace(); Log.v(LOG_TAG,"Cannot schedule Calendar event as specifIEd "); return false;}解决方法 你检查了 http://developer.android.com/guide/topics/providers/calendar-provider.html#reminders的例子吗?
long eventID = 221;...ContentResolver cr = getContentResolver();ContentValues values = new ContentValues();values.put(Reminders.MINUTES,15);values.put(Reminders.EVENT_ID,eventID);values.put(Reminders.METHOD,Reminders.METHOD_ALERT);Uri uri = cr.insert(Reminders.CONTENT_URI,values);总结
以上是内存溢出为你收集整理的如何在Android设备的日历应用程序上以编程方式填充“提醒”部分?全部内容,希望文章能够帮你解决如何在Android设备的日历应用程序上以编程方式填充“提醒”部分?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)