How to show json response in other activity?

痴心易碎 提交于 2019-12-04 21:41:16
Darpan

Parse the response you have received, and store it in a arrayList with the custom object you create to store your each response line.

{"match_detail_id":369,"profile_id":"GM686317","name":"Sonal Patel","image":"","location":"Rajkot ,Gujarat ,India","mothertongue":"Gujarati","religion":"Hindu","occupation":"Professor \/ Lecturer","education":"Masters - Arts\/ Science\/ Commerce\/ Others"}

this is your one line, so object class would be like this -

public class ResultObejct implements parcelable {

    String match_detail_id;
    String profile_id;
    String name;
    String image;

    public String getName(){ //set getter and setters
    return this.name;
...
...
...

}

And Like this link, put your data in intent,

Intent i = new Intent(...);
i.putExtra("data", new DataWrapper(yourArrayList));

and retrieving in next activity:

DataWrapper dw = (DataWrapper) getIntent().getSerializableExtra("data");
ArrayList<Parliament> list = dw.getParliaments();
Babin

Store the response data in a map and pass it to next activity.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!