I had the same problem.
The 1st approach applies all the necessary data with the intention as additional functions, and then begins the required activity with this intention. Inside a new activity, get all the extra features from intention. This approach works for a small amount of data, but not very good if you need to transfer a large amount of data to another activity.
The second approach I used is the following.
Create a model class that stores all the required data fields. Make an arraylist of your model class and fill your recyclerview with this arraylist. Now each element of your arraylist is an object of a model class.
Suppose
your model class is MyModel.java
your arraylist ArrayList <'MyModel> myArrayList
Now make a global reference to your model class. eg
MyModel model;
create setter and getter methods for the link above.
Now, since every element of your recyclerview is an object of a model class. when you click on an element, inside the onClick method, set the global link to the click object (model class object) above using the setter method. Then start a new activity (from within the onClick method) using the intent and inside onCreate of the newly created activity, access the global refernce. Thus, you can access the clicked element (model object) and get the required fields (data) from this object.
source share