社区
Android
帖子详情
andriod下获得 parse json
wj84507657
2015-04-21 03:41:31
想得到 entries 下的list
JsonArray 怎么写
...全文
85
3
打赏
收藏
andriod下获得 parse json
想得到 entries 下的list JsonArray 怎么写
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
雪月弦歌
2015-04-21
打赏
举报
回复
栗子: {"calendar": {"calendarlist": [ {"calendar_id":"1705","title":"(\u4eb2\u5b50)ddssd","category_name":"\u9ed8\u8ba4\u5206\u7c7b","showtime":"1288927800","endshowtime":"1288931400","allDay":false}, {"calendar_id":"1706","title":"(\u65c5\u884c)","category_name":"\u9ed8\u8ba4\u5206\u7c7b","showtime":"1288933200","endshowtime":"1288936800","allDay":false} ] } } JSON转换 JSONObject jsonObject = new JSONObject(builder.toString()) .getJSONObject("calendar"); JSONArray jsonArray = jsonObject.getJSONArray("calendarlist"); for(int i=0;i<jsonArray.length();i++){ JSONObject jsonObject2 = (JSONObject)jsonArray.opt(i); CalendarInfo calendarInfo = new CalendarInfo(); calendarInfo.setCalendar_id(jsonObject2.getString("calendar_id")); calendarInfo.setTitle(jsonObject2.getString("title")); calendarInfo.setCategory_name(jsonObject2.getString("category_name")); calendarInfo.setShowtime(jsonObject2.getString("showtime")); calendarInfo.setEndtime(jsonObject2.getString("endshowtime")); calendarInfo.setAllDay(jsonObject2.getBoolean("allDay")); calendarInfos.add(calendarInfo); }
粗鄙之语
2015-04-21
打赏
举报
回复
详情参见API文档,个人认为还是用fastjson比较方便。
只为搞笑
2015-04-21
打赏
举报
回复
其实和java是一样的,百度下吧
JSON
Parse
:Android
JSON
解析
JSON
Parse
Android
JSON
解析
JSON
的
parse
()方法介绍
我们可以使用
JSON
.
parse
() 方法将数据转换为 JavaScript 对象。 语法
JSON
.
parse
(text[, reviver]) 参数说明: text:必需, 一个有效的
JSON
字符串。 reviver: 可选,一个转换结果的函数, 将为对象的每个成员...
JSON
基础入门实战讲解
讲解
JSON
对象,
JSON
数组,
JSON
对象和数组的嵌套,
JSON
数据的修改和删除,字符串如何转
JSON
,
JSON
如何转字符串,函数
JSON
.
parse
,函数
JSON
.stringify,函数eval的使用,如何获取远程数据转
JSON
等
Android代码-一个很好用的通知栏推送(Convert
JSON
to Android Notification)
Convert
JSON
to Android Notification. This is very useful for push notification (GCM). Usage Notification notification =
Json
2Notification.from(context).with(
json
).notification(); NotificationManager ...
Android数据解析(xml、
json
)
simple-xml包解析xml格式数据、SAX解析xml格式数据。jackson包解析
json
格式数据。
Android
80,351
社区成员
91,288
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章