将数组字符串转换为列表?添加所有部分错误

时间:2012-10-16 08:03:30

标签: android listview arraylist android-fragments adapter

EQName列表从服务调用         JSONArray EQResponseArray = new JSONArray(EQSpecifCompanrison);

    int EQResponseSize = EQResponseArray.length();
    String[] EQName = new String[EQResponseSize];

     for(int i = 0; i< EQResponseSize; i++)
     {
       JSONObject EQResponseObject = EQResponseArray.optJSONObject(i);
       int EQ_ID = EQResponseObject.optInt("EquipmentStatusId");
       EQID[i] = EQ_ID;  
       String EQ_Name = EQResponseObject.optString("EquipmentStatusDescription");
       EQName[i] = EQ_Name; 
       int EQ_PlantID = EQResponseObject.optInt("equipmentParentStatusId");
       EQPlantID[i] = EQ_PlantID;

      }



  I have problem in AddALL section. I think problem in to convert how it will be? Planet constructer takes list items but my list have array list.
     ArrayList<Planet> planetList = new ArrayList<Planet>();

      Object[] mStringArray = planetList.toArray();
      planetList.addAll(EQName);
      listAdapter = new PlanetArrayAdapter(getActivity(), planetList);
      SpecificList.setAdapter( listAdapter );  

0 个答案:

没有答案