Quick Answer: How Pass Json Array from One Activity to Another in Android?
Contents

You just need to convert your JSONArray into a string for us to pass it to another Activity. Then, on your next activity just convert it again from String back to JSONArray. That’s it simple.

How send JSON array to another activity in Android?

You should convert JsonArray to String then attach it to Intent and send it. JSONObject jObject = new JSONObject(“Your Json Response”); Intent obj_intent = new Intent(Main. this, Main1. class); Bundle b = new Bundle(); b.

How pass JSON object from one activity to another in Android?

3 Answers. You should pass a serializable or parcelable object through putExtra, as JSONObject is neither serializable nor parcelable object, and so you cant pass it through putExtra. So you need to make either a Parcelable or Serializable class from parsing a JSONObject, then you can use putExtra method to pass it.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest