Chinaunix首页 | 论坛 | 博客
  • 博客访问: 408798
  • 博文数量: 121
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1393
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-11 12:17
个人简介

www.vibexie.com vibexie@qq.com

文章分类

全部博文(121)

文章存档

2015年(55)

2014年(66)

我的朋友

分类: Android平台

2015-04-11 21:21:09

有待改进。。。

JsonUtil.java

  1. package com.vibexie.listview;

  2. import org.json.JSONArray;
  3. import org.json.JSONException;
  4. import org.json.JSONObject;

  5. import java.util.ArrayList;
  6. import java.util.List;

  7. /**
  8.  * Created by vibexie on 3/23/15.
  9.  */
  10. public class JsonUtil {
  11.     public static List<String> parseJsonList(String jsonString){
  12.         List<String> list=new ArrayList<String>();
  13.         try {
  14.             JSONObject jsonObject=new JSONObject(jsonString);
  15.             JSONArray jsonArray=jsonObject.getJSONArray("data");
  16.             for(int i=0;i<jsonArray.length();i++){
  17.                 list.add(jsonArray.getString(i));
  18.             }
  19.         } catch (JSONException e) {
  20.             e.printStackTrace();
  21.         }
  22.         return list;
  23.     }
  24. }

阅读(1477) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~