Stay organized with collections
Save and categorize content based on your preferences.
OnDateChangedListener
interface OnDateChangedListener
The callback used to indicate the user changed the date.
Summary
Public methods |
abstract Unit |
Called upon a date change.
|
Public methods
onDateChanged
abstract fun onDateChanged(
view: DatePicker!,
year: Int,
monthOfYear: Int,
dayOfMonth: Int
): Unit
Called upon a date change.
Parameters |
view |
DatePicker!: The view associated with this listener. |
year |
Int: The year that was set. |
monthOfYear |
Int: The month that was set (0-11) for compatibility with java.util.Calendar . |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DatePicker.OnDateChangedListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnDateChangedListener\n=====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/DatePicker.OnDateChangedListener \"View this page in Java\") \n\n```\ninterface OnDateChangedListener\n```\n\n|------------------------------------------------------|\n| [android.widget.DatePicker.OnDateChangedListener](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [DatePickerDialog](../app/DatePickerDialog.html#) |---------------------------------------------------|---------------------------------------------------------------------------------------------------------| | [DatePickerDialog](../app/DatePickerDialog.html#) | A simple dialog containing an [android.widget.DatePicker](/reference/kotlin/android/widget/DatePicker). | |\n\nThe callback used to indicate the user changed the date.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDateChanged](#onDateChanged(android.widget.DatePicker,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`view:` `[DatePicker](/reference/kotlin/android/widget/DatePicker)!`, `year:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `monthOfYear:` `[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 a date change. |\n\nPublic methods\n--------------\n\n### onDateChanged\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onDateChanged(\n view: DatePicker!, \n year: Int, \n monthOfYear: Int, \n dayOfMonth: Int\n): Unit\n```\n\nCalled upon a date change.\n\n| Parameters ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | [DatePicker](/reference/kotlin/android/widget/DatePicker)!: The view associated with this listener. |\n| `year` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The year that was set. |\n| `monthOfYear` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The month that was set (0-11) for compatibility with [java.util.Calendar](../../java/util/Calendar.html#). |\n| `dayOfMonth` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The day of the month that was set. |"]]