title: Parsing JSON array of objects in android
body: <p>I want to get the lineId, destinationName and timeToStation from this api call <a href="https://api.tfl.gov.uk/Line/25,86,w19/Arrivals?stopPointId=490009219W&amp;app_id=&amp;app_key=" rel="nofollow">https://api.tfl.gov.uk/Line/25,86,w19/Arrivals?stopPointId=490009219W&amp;app_id=&amp;app_key=</a>
  Can someone help with example please?<code>
  [
    {
      "$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
      "id": "-480785385",
      "operationType": 1,
      "vehicleId": "BJ11DSX",
      "naptanId": "490009219W",
      "stationName": "Little Ilford Lane",
      "lineId": "25",
      "lineName": "25",
      "platformName": "B",
      "direction": "inbound",
      "bearing": "245",
      "destinationNaptanId": "",
      "destinationName": "Oxford Circus",
      "timestamp": "2016-04-17T16:56:56.463Z",
      "timeToStation": 1534,
      "currentLocation": "",
      "towards": "East Ham or Manor Park",
      "expectedArrival": "2016-04-17T17:22:31Z",
      "timeToLive": "2016-04-17T17:23:01Z",
      "modeName": "bus"
    },
    {
      "$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
      "id": "1992301652",
      "operationType": 1,
      "vehicleId": "BJ11DVA",
      "naptanId": "490009219W",
      "stationName": "Little Ilford Lane",
      "lineId": "25",
      "lineName": "25",
      "platformName": "B",
      "direction": "inbound",
      "bearing": "245",
      "destinationNaptanId": "",
      "destinationName": "Oxford Circus",
      "timestamp": "2016-04-17T16:56:56.463Z",
      "timeToStation": 1159,
      "currentLocation": "",
      "towards": "East Ham or Manor Park",
      "expectedArrival": "2016-04-17T17:16:16Z",
      "timeToLive": "2016-04-17T17:16:46Z",
      "modeName": "bus"
    },
    {
      "$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
      "id": "733078946",
      "operationType": 1,
      "vehicleId": "BJ11DVG",
      "naptanId": "490009219W",
      "stationName": "Little Ilford Lane",
      "lineId": "25",
      "lineName": "25",
      "platformName": "B",
      "direction": "inbound",
      "bearing": "245",
      "destinationNaptanId": "",
      "destinationName": "Oxford Circus",
      "timestamp": "2016-04-17T16:56:56.463Z",
      "timeToStation": 790,
      "currentLocation": "",
      "towards": "East Ham or Manor Park",
      "expectedArrival": "2016-04-17T17:10:07Z",
      "timeToLive": "2016-04-17T17:10:37Z",
      "modeName": "bus"
    }
  ]</code></p>
  
  <p>My AsyncTask is given belw</p>
  
  <pre><code>   @Override
      protected JSONObject doInBackground(String... args){
         JSONParser jsonParser = new JSONParser();
  
          Log.i("URL", url);
          JSONObject json = jsonParser.getJSONFromUrl(url);
          if(json == null) {
              Log.i("Json obj =" , "NULL");
          }
          else{
              return json;
          }
          return new JSONObject();
      }
  
      @Override
      protected void onPostExecute(JSONObject json){
          progressDialog.dismiss();
          //String shopName ="";
         // String distance="";
  
          try{
              //Fetching JSON Array
              Log.i("JSON", json.toString());
  
              jsonData = new JSONArray(json);
  
              Double arrivalTime= 0.0;
  
              for(int i=0;i&lt;json.length();i++) {
  
                  try {
                      JSONObject c = json.getJSONObject(i);
  
                      busNoArray.add(json.getString(TAG_LINEID));
                      destinationArray.add(json.getString(TAG_DESTINATION));
  
                      arrivalTime = json.getDouble(TAG_TIME) / 60;
                      arrivalTimeArray.add(arrivalTime);
  
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
  
              }
  
              adapter = new BusTimeAdapter(BusTimeActivity.this,busNoArray, destinationArray, arrivalTimeArray);
              mListView.setAdapter(adapter);`
  </code></pre>
  
  <p>Can someone help me pls?</p>