I need to parse a 2D array in Android and passing them as intent in another activity. How do I do that?
I am getting the following 2D array as a response from the server.
[
{
"sno": "131",
"email": "ruma.riwaz@gmail.com",
"place": "43",
"description": "",
"image": "",
"time": "1316156532"
},
{
"sno": "130",
"email": "ruma.riwaz@gmail.com",
"place": "38",
"description": "",
"image": "",
"time": "1316153291"
},
{
"sno": "365",
"email": "ruma.riwaz@gmail.com",
"place": "86",
"description": "",
"image": "",
"time": "1318427821"
},
{
"sno": "129",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1316152314"
},
{
"sno": "371",
"email": "ruma.riwaz@gmail.com",
"place": "90",
"description": "",
"image": "",
"time": "1318502879"
},
{
"sno": "370",
"email": "ruma.riwaz@gmail.com",
"place": "89",
"description": "",
"image": "",
"time": "1318495237"
},
{
"sno": "366",
"email": "ruma.riwaz@gmail.com",
"place": "86",
"description": "",
"image": "",
"time": "1318427852"
},
{
"sno": "126",
"email": "ruma.riwaz@gmail.com",
"place": "43",
"description": "",
"image": "",
"time": "1316149489"
},
{
"sno": "125",
"email": "ruma.riwaz@gmail.com",
"place": "43",
"description": "",
"image": "",
"time": "1316148422"
},
{
"sno": "168",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1316265504"
},
{
"sno": "368",
"email": "ruma.riwaz@gmail.com",
"place": "87",
"description": "",
"image": "",
"time": "1318480496"
},
{
"sno": "174",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1316667799"
},
{
"sno": "176",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1316670052"
},
{
"sno": "252",
"email": "ruma.riwaz@gmail.com",
"place": "54",
"description": "",
"image": "",
"time": "1317471220"
},
{
"sno": "300",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1317964945"
},
{
"sno": "299",
"email": "ruma.riwaz@gmail.com",
"place": "39",
"description": "",
"image": "",
"time": "1317964703"
},
How do I fix this problem?
FYI,
myObjectis the class that I have taken just for the reference and just defined getter and setter methods for all the above attributes inside thismyObjectclass. And now when you are done with it, implement the below code to prepare an arraylist of all the items that your JSON contains.