zoukankan      html  css  js  c++  java
  • 获取没有key值的数据,用循环器

                JSONObject jsonObject = new JSONObject(json);
                            Iterator<?> it = jsonObject.keys();
                            while (it.hasNext()) {// 遍历JSONObject
                                key = (String) it.next().toString(); // 所有的key值
                                value = jsonObject.getString(key); // 所有的value值
                                ContentValues values = new ContentValues();
                                values.put(Const_Area.TABLE_NAME_AREA_FIELD_ID, key);
                                values.put(Const_Area.TABLE_NAME_AREA_FIELD_NAME,
                                        value);
                                db.insert(Const_Area.TABLE_NAME_AREA, null, values);

  • 相关阅读:
    ssh 远程命令
    POJ 2287
    POJ 2376
    hihoCoder1488
    POJ1854
    HDU 5510
    HDU 4352
    CodeForces 55D
    HDU 1517
    CodeForces 1200F
  • 原文地址:https://www.cnblogs.com/Jingerxin/p/5663822.html
Copyright © 2011-2022 走看看