alexa

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
})

280 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

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry