title: Error parsing JSON array in Java/Android
body: <p>I have recently settup a php page on my server that runs through my database and outputs this onto the page.</p>
  
  <pre><code>JSONObject json = JSONfunctions.getJSONfromURL("http://abc.com/getjson.php");
  
          try{
  
              JSONArray  myArray = json.getJSONArray("date");
  
              for(int i=0;i&lt;myArray.length();i++){                        
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    
                  JSONObject e = myArray.getJSONObject(i);
  
                  map.put("id",  String.valueOf(i));
                  map.put("date", "date name:" + e.getString("date"));
                  map.put("activity", "activity: " +  e.getString("activity"));
                  mylist.add(map);            
              }
  </code></pre>
  
  <p><a href="http://abc.com/getjson.php" rel="nofollow">http://abc.com/getjson.php</a> outputs:</p>
  
  <pre><code>[{"date":"2012-04-23","activity":"gym"},{"date":"2012-04-24","activity":"walkin‌​g"}]
  </code></pre>