How to use Lambda function in Android
In my application I have RecyclerView adapter and I want when click on Items, send some data to parent.
I want send model and string.
I write below codes, but after use show me error and I can't use this!
Lambda function in adapter :
private var onItemClickListener: ((UserEntity) -> Unit)? = null
private var actionType: String? = null
fun setOnItemClickListener(listener: (UserEntity) -> Unit, type: String) {
onItemClickListener = listener
actionType = type
}
Use this function...