Skip to content

Instantly share code, notes, and snippets.

@IhorKlimov
Created November 27, 2016 17:01
Show Gist options
  • Save IhorKlimov/9eca7166471bf16410da60697ca8726f to your computer and use it in GitHub Desktop.
Save IhorKlimov/9eca7166471bf16410da60697ca8726f to your computer and use it in GitHub Desktop.
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.binding.setItem(mValues.get(position));
holder.binding.getRoot().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (null != mListener) {
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mListener.onListFragmentInteraction(holder.binding.getItem());
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment