Skip to content

Instantly share code, notes, and snippets.

View capella55's full-sized avatar
🏠
Working from home

Capella capella55

🏠
Working from home
View GitHub Profile
@capella55
capella55 / post.md
Created October 5, 2016 03:02 — forked from grantland/post.md
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder