第一种:

[
{
"0": "1",
"1": "一",
"id": "1",
"nam": "一"
},
{
"0": "2",
"1": "二",
"id": "2",
"nam": "新二"
},
{
"0": "3",
"1": "三",
"id": "3",
"nam": "三"
},

]

解析方法:第一种直接是数组所以直接获取到jsonArray直接拿来解析用循环获取对象然后获取里面的值

List name = new ArrayList<String>();
try
{
JSONArray jsonArray = new JSONArray(result);
for (int j = 0; j < jsonArray.length(); j++)
{
JSONObject jsonObject= jsonArray.getJSONObject(j);
String title= jsonObject.getString("nam");
name.add(title);
}

}
catch (Exception e)
{
e.printStackTrace();
}

第二种:

比第一种多了一个中括号 

 List iconName= new ArrayList<String>();
try{

JSONObject jsonObject = new JSONObject(result);//获取json对象
       
        JSONObject type=jsonObject.getJSONObject("type");//type里面的数据

JSONArray jsonArray=jsonObject.getJSONArray("conts");//将有中括号中的json数据放入JsonArray里
Log.e("length",jsonArray.length()+"");
for (int j = 0; j < jsonArray.length(); j++)    //循环获取里面的数据
{
JSONObject json= jsonArray.getJSONObject(j);
System.out.print(jsonObject.toString());
String title= json.getString("nam");
// Log.e("title",title);
iconName.add(title);          //将获取到的数据放入集合
}

}
catch (Exception e)
{
e.printStackTrace();
}

{
"type": {
"0": "1",
"1": "本院介绍",
"2": "1",
"3": "100.php?id=1&fun=load",
"id": "1",
"nam": "本院介绍",
"weight": "1",
"url": "100.php?id=1&fun=load"
},
"conts": [
{
"0": "1",
"1": "一",
"id": "1",
"nam": "一"
},
{
"0": "3",
"1": "三",
"id": "3",
"nam": "三"
},
{
"0": "2",
"1": "二",
"id": "2",
"nam": "二"
}

]
}