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);

posted on 2016-07-12 15:54  Jinger1992223  阅读(266)  评论(0编辑  收藏  举报