I am trying create a calendar view where the user selects a day from a calendar and then displays the day month and year.
val calendar = findViewById(R.id.calendarView)
calendar.SetOnDateChangeListener(object : calendar.onDateChangeListener() {
fun onSelectedDayChange(@NonNull calendarView: calender, i: Int, il: Int, i2: Int) {
val date = i + "/" + il + "/" + i2
val intent = Intent(this@CalenderActivity, MainActivity::class.java)
intent.putExtra("date", date)
startActivity(intent)
}
}
I get this error message:
Unresolved reference: calendar at the SetOnDateChangeListener.
What am I doing wrong?