alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

Using onClickListener in Recycler View with Retrofit Structure in Android ?

Using onClickListener in Recycler View with Retrofit Structure in Android ?

I think the easiest way is passing function as parameter to RecyclerViewAdapter.

for instance:

 RecyclerViewAdapter(val clickListener : () -> Unit)

onCreateViewHolder(){
clickListener.invoke()
} 

in your view

 adapter = ReceylerViewAdapter({
//do your stuff here
})

38 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online