Prior to introducing RecyclerView (and its required ViewHolder template), I usually delegated any click events to the corresponding Activity / Fragment using setOnItemClickListener() . (Because I basically see Activity / Fragment as an “controller” object when developing for Android, so any kind of change of view should be made in it.)
Now, since RecyclerView doesn’t really apply to its children in the same way, and that the setOnItemClickListener() (or similar) methods no longer execute for it - where should I handle the click events that may take place? I don’t know ... but processing them in Adapter seems to me inconvenient.
How should we do this?
Thanks in advance!
android android-adapter android-adapterview
ridsatrio
source share