title: Parse JSON and retrieve Last Element
body: <p>I have the following <strong>JSON</strong> below I want to retrieve the value of the that last dateTime at the end 2011-05-01</p>
  
  <pre><code>{
      "activities-log-steps":[
          {"dateTime":"2011-04-27","value":5490},
          {"dateTime":"2011-04-28","value":2344},
          {"dateTime":"2011-04-29","value":2779},
          {"dateTime":"2011-04-30","value":9196},
          {"dateTime":"2011-05-01","value":15828},
          {"dateTime":"2011-05-02","value":1945},
          {"dateTime":"2011-05-03","value":366}
      ]
  }
  </code></pre>
  
  <p>I have included the code for the current method I am using to try and retrieve that value.</p>
  
  <pre><code> protected void onPostExecute(JSONObject jsonObject) {
              Calendar cal = Calendar.getInstance();
              cal.add(Calendar.DATE, 1);
              SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
              String currentDate = format1.format(cal.getTime());
              if (jsonObject != null) {
  
                  try {
  
                      name = jsonObject.getString("dateTime" + ":" + "" + currentDate + "," + "value");
                      Toast.makeText(getActivity(), name, Toast.LENGTH_LONG).show();
                      Log.d("Token Access", name);
                      //  _access.setText("Access Token:" + heartrate);
                      new refresh().execute();
                  } catch (JSONException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
  
              } else {
                  Toast.makeText(getActivity(), "Network Error", Toast.LENGTH_SHORT).show();
  
              }
          }
      }
  </code></pre>
  
  <p>This is not returning a value </p>