我想要创建一个日历视图,其中包含预先创建的事件(来自DB)。此外,我将能够创建事件在每个日期的事件持续时间。是否有任何库(付费或免费)或开放源码项目这样做?
发布于 2013-09-06 05:53:14
我创建了简单的DayView日历github,对于Monthview实现,您可以签出这个链接,您可以修改它以显示来自DB()的事件,在下面的方法中进行db调用,创建一个hashmap,并在网格单元格适配器中的getView()方法中获得相应的值。
private HashMap findNumberOfEventsPerMonth(int year, int month)
{
HashMap map = new HashMap<String, Integer>();
// DateFormat dateFormatter2 = new DateFormat();
//
// String day = dateFormatter2.format("dd", dateCreated).toString();
//
// if (map.containsKey(day))
// {
// Integer val = (Integer) map.get(day) + 1;
// map.put(day, val);
// }
// else
// {
// map.put(day, 1);
// }
return map;
}https://stackoverflow.com/questions/18650615
复制相似问题