I have implemented CustomAlertDialogBuilder
but I am getting the following warning:
The object is not abstract and does not implement abstract member
Below is my code:
override fun onEditClick(item: Question) {
CustomAlertDialogBuilder(context).setCancelable(true)
CustomAlertDialogBuilder(context).addMessage(R.string.chat_message).setPositiveButton(R.string.chat,
object : CustomAlertDialogBuilder.OnItemDialogClickListener {
override fun onClick(dialog: CustomAlertDialogBuilder.CustomDialogInterface) {
val intent = Intent(context, ChatActivity::class.java)
startActivity(intent)
}
}).setNegativeButton("OK", null).build()?.show()
}
Below is the screenshot of the error:
Below CustomDialogBuilder.OnItemDialogClickListener
interface:
interface OnItemDialogClickListener {
fun onClick(dialog: CustomDialogInterface)
fun onClick(arg0: CustomAlertDialogBuilder, arg1: Int)
}
You should add
arg1:Int
as the second param of overriddenonClick
function and make type of first parameter asCustomAlertDialogBuilder
, e.g.:Also check if other methods of
CustomAlertDialogBuilder.OnItemDialogClickListener
are implemented.