android - 当我在 android 日历 ListView 中单击重置按钮时如何清除选定的日期范围

标签 android android-calendar

在我的应用程序中,我实现了一个日历 View 来选择日期范围。工作正常,但我想在单击重置按钮时重置选择日期。我正在使用 onDateRangeSelected() 方法来选择日期范围。

使用此源代码获取 CalendarView:CalendarView Code

如果有人知道此功能,请帮助我。

这是所需的屏幕。

required screen screenshot

最佳答案

您可以尝试从 setController 方法调用 mAdapter.setSelectedDay(null);。 它将清除选定的日期范围。 希望它能帮助你#happycoding。

关于android - 当我在 android 日历 ListView 中单击重置按钮时如何清除选定的日期范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53953834/

相关文章:

android - 从字符串数组中过滤数字并获取android中最后两个更大数字的索引

android - 创建数据库,表并插入数据并在android中检索它

java - StartActivityForResult 不暂停主 Activity

Android 应用程序 ABI 和 native 调试

android MediaPlayer NullPointerException

android - 找出两毫秒之间的天数、周数、月数和年数。

android - 用户输入年、月、日、时、分与系统年、月、日、时、分的区别

java - Android日历10分钟后删除日历和事件

android - 使用字符串日期和时间在 Android 日历中创建事件

android - 解析 CalendarContract.Events.DURATION 值