从JSON对象的Android获取字符串值 [英] Getting String Value from Json Object Android
本文介绍了从JSON对象的Android获取字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我Begineer在Android.In我的项目,我从HTTP响应收到下面的JSON。
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"}]
我想从上面json.How的NeededString得到它。
I want to get the "NeededString" from the above json.How to get it.
推荐答案
这可能会帮助你。
JSONArray arr = new JSONArray(result);
JSONObject jObj = arr.getJSONObject(0);
String date = jObj.getString("NeededString");
这篇关于从JSON对象的Android获取字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文