DatePickerDialogFragment
extends DialogFragment
, for example:
val datePicker = DatePickerDialogFragment(this)
val ft = supportFragmentManager.beginTransaction()
val prev = supportFragmentManager.findFragmentByTag("dialog")
if (prev != null)
{
ft.remove(prev)
}
ft.addToBackStack(null)
datePicker.isCancelable = true
datePicker.show(ft, "dialog")
DatePicker is installed by adding the following dependency to your build.gradle
file:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.myozaw00:mmcalendar:1.1.5'
}