I have String like
[
{
"Title":"name",
"Value":"Sam"
},
{
"Title":"mobile",
"Value":"(606) 87-0238"
}
]
want to convert it into List<JSONobj> list of JSONObject.
-
4can we see what you have tried so far? so that we can append our ideas to your ideas.rahul– rahul2016年01月06日 11:46:19 +00:00Commented Jan 6, 2016 at 11:46
-
4stackoverflow.com/help/how-to-askAdnan Abdollah Zaki– Adnan Abdollah Zaki2016年01月06日 11:47:17 +00:00Commented Jan 6, 2016 at 11:47
-
Use JsonParser to parse this String. Refer this answerJas– Jas2016年01月06日 11:49:35 +00:00Commented Jan 6, 2016 at 11:49
-
Please mind all above comments and visit Convert JSONArray to String ArrayBharatesh– Bharatesh2016年01月06日 11:57:46 +00:00Commented Jan 6, 2016 at 11:57
-
please elaborate how to use Jsonparser fro this Stringsang– sang2016年01月06日 12:00:46 +00:00Commented Jan 6, 2016 at 12:00
1 Answer 1
ArrayLis<JSONObject> list=new ArrayList<JSONObject>();
JSONArray arr= new JSONArray("json string");
for(int i=0;i<arr.length();i++){
JSONObject obj=arr.getJSONObject(i);
list.add(obj);
}
You have to do something like this.
answered Jan 6, 2016 at 15:03
Krishna Satwaji Khandagale
2,27018 silver badges25 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
Biswajit Das
This should be Correct in my case.
default