-6

How do I pass ArrayList of JSONObjects from RecyclerView's viewholder to another activity through intents?

2 Answers2

0

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()

Radwa
  • 325
  • 4
  • 21
  • it says : ArrayList cannot be converted to ArrayList extends Parcelable> – Chitransh Srivastava Jul 02 '18 at 09:47
  • Convert your JSONObject to java object like descriptive here https://stackoverflow.com/questions/35210070/converting-jsonobject-to-java-object then use Parcelable approach – Radwa Jul 02 '18 at 12:00
0

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);
Hitesh Raviya
  • 129
  • 6
  • 13