when i click on button 1 item add in my recyclerview in kotlin android code example
Example 1: how to add button in recyclerview fragment in kotlin
holder.accept.setOnClickListener {
if (context != null) {
context.supportFragmentManager
.beginTransaction()
.replace(R.id.schoolcontainer, DetailSchoolFragment.newInstance())
.commit()
}
}
Example 2: recyclerview onclicklistener kotlin
val data = list[position]holder.itemView.setOnClickListener { cellClickListener.onCellClickListener(data)}