-6

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

1
  • You can Serialize your Model and then you can pass with Intent , for more help share your code. Commented Jul 2, 2018 at 9:15

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

2 Comments

it says : ArrayList<JSONObject> cannot be converted to ArrayList<? extends Parcelable>
Convert your JSONObject to java object like descriptive here stackoverflow.com/questions/35210070/… then use Parcelable approach
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);

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.