adapter click listener kotlin code example
Example 1: onclicklistener recyclerview only first item worked problem kotlin
//use view.id then R.id. ....
override fun onItemClicked(position: Int, view: View) {
when (view.id) {
R.id.btn_cat_delete -> {
}
R.id.btn_cat_add_words -> {
}
R.id.btn_cat_all_diktat -> {
}
R.id.btn_cat_edit -> {
}
}
Example 2: recyclerview onclicklistener kotlin
interface CellClickListener { fun onCellClickListener(data: Model)}