Измените объявления переменных с val
на var
и обновите их внутри слушателя:
val c = Calendar.getInstance()
var day = c.get(Calendar.DAY_OF_MONTH)
var month = c.get(Calendar.MONTH)
var year = c.get(Calendar.YEAR)
val dpd = DatePickerDialog(
this,
android.R.style.Theme_Holo_Dialog,
DatePickerDialog.OnDateSetListener { datePicker, selyear, monthOfYear, dayOfMonth ->
day = dayOfMonth
month = monthOfYear + 1
year = selyear
tv.text = "$day - $month - $year"
}, year, month, day
)
dpd.show()