0

EQName list calling from the service 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 );  
5
  • I mean :Convert String [] to ArrayList<String> Commented Oct 16, 2012 at 8:09
  • The answer is in one post ..... [Convert String to Array (android)][1] [1]: stackoverflow.com/questions/1360513/… Commented Oct 16, 2012 at 8:11
  • can you please explain me brief i didt get that Commented Oct 16, 2012 at 8:18
  • Java101 : ArrayList extends List, hence can be used where List is expected. Commented Oct 16, 2012 at 8:24
  • please take a look on this code, planetList.addAll(EQName) have got error because my EQname is string array and planetlist takes List Commented Oct 16, 2012 at 8:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.