| Start |
|---|
| Kotlin and RxJava example First example reimplemented in Kotlin and using RxJava for cleaner interaction. Usage is quite simple then. It's possible to subscribe on separate thread using RxJava facilities. |
RecyclerView Click listener In MainActivity |
| Another way to implement Item Click Listener Another way to implement item click listener is to use interface with several methods, the number of which is equal to the number of clickable views, and use overrided click listeners as you can see below. This method is more flexible, because you can set click listeners to different views and quite easy control the click logic separately for each. And when you have an instance of adapter, you can set your click listener which listens to clicking on each of the views: |
New Example |
| Easy OnLongClick and OnClick Example First of all, implement your view holder: Then, register the listeners as follows: Next, override the listeners as follows: And finally, add the following code: Adaptor demoThe example code above can be called by the following code: |
| Item Click Listeners To implement an item click listener and/or an item long click listener, you can create an interface in your adapter: Then you can set your click listeners after you create an instance of the adapter: |
Read Article
https://develop.horje.com/learn/1434/reference