In the below example I have created a RecyclerView, In RecyclerView I have added cardView item, so when you click on cardview item it will open next activity.
In below code, first I have added RecyclerView and CardView library , In second step, In actvity_main.xml layout I have created RecyclerView and included Toolbar. In third step I have created toolbar.xml layout here I have added toolbar. In forth step I have created row.xml layout here I have added CardView , ImageView and TextView.
In fifth step I have created Item class here I have defined image title and subtitle. In six step I have created MyAdapter class and extend this class with RecyclerView and adapter, here I have also created MyViewHolder class and I have used onClick method to get position item.
In MainActivity I have set adapter and created prepareItem class to add items, image title and subtitle value. In next step I have created a ClickListener interface. In Last step I have created Main2Actvity here I have used OnClickListener() and Intent method for retuning previous activity. You can see below example code it clearly describe you How to go next Activity click On CardView Item in android.
Step(1)-I have added RecyclerView, CardView and design library in build.gradle file -