java – How to pass all item values ​​to RecycleView?


I have a recycleview with data and I need to pass all the items data to another activity, how can I implement this?


Why make such a crutch as in the previous answer, if any model can be made serializable ( implements Parcelable ) and pass the entire model as a whole?

Put in intent: intent.putExtra("parcelable", myParcelables.get(position))

Take from intent: MyParcelable model = getIntent().getParcelableExtra("parcelable")

implementation example:

public class Country implements Parcelable {

    private String code;

    private String name;

    private String tag;

    private int limit;

    private String image;

    public Country(JSONParser data) {
        code = data.getString("code");
        name = data.getString("value");
        tag = data.getString("flag");
        image = data.getString("image");
        if (data.contains("limit")) {
            limit = data.getInt("limit") - code.length();

    public Country(Parcel in) {
        code = in.readString();
        name = in.readString();
        tag = in.readString();
        image = in.readString();
        limit = in.readInt();

    public static final Creator<Country> CREATOR = new Creator<Country>() {
        public Country createFromParcel(Parcel in) {
            return new Country(in);

        public Country[] newArray(int size) {
            return new Country[size];

    public int describeContents() {
        return 0;

    public void writeToParcel(Parcel dest, int flags) {

    public String getClearCode() {
        return code;

    public String getCode() {
        return "+" + code;

    public String getName() {
        return name;

    public String getTag() {
        return tag;

    public int getLimit() {
        return limit;

    public String getImage() {
        return image;


In order not to catch BadParcelableException when passing between activities, the Parcelable constructor must initialize the data in the same order in which they were written to Parcel in the void writeToParcel(Parcel, int) method

Scroll to Top