我正在尝试在我的软件中实现 Caldroid。为了检查用户是否点击了任何东西,我设置了一个这样的监听器:
val listener = object : CaldroidListener() {
fun onSelectDate(date: Date, view: View) {
Toast.makeText(
applicationContext, formatter.format(date),
Toast.LENGTH_SHORT
).show()
}
override fun onChangeMonth(month: Int, year: Int) {
val text = "month: $month year: $year"
Toast.makeText(
applicationContext, text,
Toast.LENGTH_SHORT
).show()
}
fun onLongClickDate(date: Date, view: View) {
Toast.makeText(
applicationContext,
"Long click " + formatter.format(date),
Toast.LENGTH_SHORT
).show()
}
override fun onCaldroidViewCreated() {
Toast.makeText(
applicationContext,
"Caldroid view is created",
Toast.LENGTH_SHORT
).show()
}
}
然而:Android在“object”标签上报错,说:“Object is not abstract and does not implement abstract base class member public abstract fun onSelectDate(date: Date!, view: View!): Unit defined in com .roomorama.caldroid.Caldroidlistener'
有谁知道如何处理这个?