gpt4 book ai didi

android - 如何从扩展日历 View android 获取当前日期、月份和年份并将事件添加到特定日期

转载 作者:行者123 更新时间:2023-11-30 01:19:12 26 4
gpt4 key购买 nike

我在我的项目中实现了扩展日历 View (com.tyczj.extendedcalendarview.ExtendedCalendarView)。但是我无法从扩展日历 View 中获取当前日期。我想从日历中获取日、月和年并显示它在另外 3 个 TextView 中。我想在某些特定日期添加事件并更改该特定日期的背景颜色。请帮我找到解决方案

最佳答案

这应该适用于日历:

final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);

关于android - 如何从扩展日历 View android 获取当前日期、月份和年份并将事件添加到特定日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37374400/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com