Passing ArrayList of JsonObjects through intents
Passing ArrayList of JsonObjects through intents
How do I pass ArrayList of JSONObjects from RecyclerView's viewholder to another activity through intents?
Dude , do you understand the rules of asking questions . share your code ,full code of your model and all
– Thunder
Jul 2 at 9:26
2 Answers
2
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()
it says : ArrayList<JSONObject> cannot be converted to ArrayList<? extends Parcelable>
– Chitransh Srivastava
Jul 2 at 9:47
Convert your JSONObject to java object like descriptive here stackoverflow.com/questions/35210070/… then use Parcelable approach
– Radwa
Jul 2 at 12:00
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);
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You can Serialize your Model and then you can pass with Intent , for more help share your code.
– Thunder
Jul 2 at 9:15