Stay organized with collections
Save and categorize content based on your preferences.
OnDateChangeListener
interface OnDateChangeListener
The callback used to indicate the user changes the date.
Summary
Public methods |
abstract Unit |
Called upon change of the selected day.
|
Public methods
onSelectedDayChange
abstract fun onSelectedDayChange(
view: CalendarView,
year: Int,
month: Int,
dayOfMonth: Int
): Unit
Called upon change of the selected day.
Parameters |
view |
CalendarView: The view associated with this listener. This value cannot be null . |
year |
Int: The year that was set. |
month |
Int: The month that was set [0-11]. |
dayOfMonth |
Int: The day of the month that was set. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CalendarView.OnDateChangeListener\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnDateChangeListener\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/CalendarView.OnDateChangeListener \"View this page in Java\") \n\n```\ninterface OnDateChangeListener\n```\n\n|-------------------------------------------------------|\n| [android.widget.CalendarView.OnDateChangeListener](#) |\n\nThe callback used to indicate the user changes the date.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSelectedDayChange](#onSelectedDayChange(android.widget.CalendarView,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`view:` `[CalendarView](/reference/kotlin/android/widget/CalendarView)`, `year:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `month:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `dayOfMonth:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called upon change of the selected day. |\n\nPublic methods\n--------------\n\n### onSelectedDayChange\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSelectedDayChange(\n view: CalendarView, \n year: Int, \n month: Int, \n dayOfMonth: Int\n): Unit\n```\n\nCalled upon change of the selected day.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | [CalendarView](/reference/kotlin/android/widget/CalendarView): The view associated with this listener. This value cannot be `null`. |\n| `year` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The year that was set. |\n| `month` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The month that was set \\[0-11\\]. |\n| `dayOfMonth` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The day of the month that was set. |"]]