Getting String Value from Json Object Android

2019-01-11 06:31发布

I am Begineer in Android.In my Project, I am getting the Following json from the HTTP Response.

[{"Date":"2012-1-4T00:00:00","keywords":null,"NeededString":"this is the sample string I am needed for my project","others":"not needed"}]

I want to get the "NeededString" from the above json.How to get it.

7条回答
Animai°情兽
2楼-- · 2019-01-11 07:23

This might help you.

JSONArray arr = new JSONArray(result);
JSONObject jObj = arr.getJSONObject(0);
String date = jObj.getString("NeededString");
查看更多
登录 后发表回答