大佬教程收集整理的这篇文章主要介绍了使用CalendarContract – Android 4.0阅读今天的所有活动,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我目前的尝试:
cursor cur = null; String selection = "((" + CalendarContract.Events.DTSTART + " >= ?) AND (" + CalendarContract.Events.DTEND + " <= ?))"; Time t = new Time(); t.setToNow(); String dtStart = Long.toString(t.toMillis(false)); t.set(59,59,23,t.monthDay,t.month,t.year); String dtEnd = Long.toString(t.toMillis(false)); String[] SELEctionArgs = new String[] { dtStart,dtEnd }; cur = c.getContentResolver().query(CalendarContract.Events.CONTENT_URI,null,SELEction,SELEctionArgs,null);
我不确定如何扩大选择或增加选择,以获得经常性事件和全天事件.任何帮助将不胜感激.
Uri.builder eventsUriBuilder = CalendarContract.Instances.CONTENT_URI .buildUpon(); ContentUris.appendId(eventsUriBuilder,timeNow); ContentUris.appendId(eventsUriBuilder,endOfToday); Uri eventsUri = eventsUriBuilder.build(); cursor cursor = null; cursor = mContext.getContentResolver().query(eventsUri,columns,CalendarContract.Instances.DTSTART + " ASC");
请注意,您必须将时间限制附加到事件uri,否则不能以其他方式进行排序.
以上是大佬教程为你收集整理的使用CalendarContract – Android 4.0阅读今天的所有活动全部内容,希望文章能够帮你解决使用CalendarContract – Android 4.0阅读今天的所有活动所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。