'Passing ArrayList of JsonObjects through intents [duplicate]
How do I pass ArrayList of JSONObjects from RecyclerView's viewholder to another activity through intents?
Solution 1:[1]
If it's just ArrayList of strings you can use
intent.putStringArrayListExtra()
if it is ArrayList of objects make your object class Parcelable and use
intent.putParcelableArrayListExtra()
Solution 2:[2]
Create Serialize your Model and create getter, setter method for all parameter which you have required. Add all model into a list of model and then use below the line.
intent.putExtra("listModel",modelist);
startActivity(intent);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Radwa |
Solution 2 | Hitesh Raviya |