title: how do i parse a dynamic JSONArray by JSONObject attribute with Handler?
body: <p>I want to parse this object from a JSON Array:</p>
  
  <p>{..."avg": 8.492619161922457352960767294, "symbol": "mtgoxUSD", "low": 8.391000000000}</p>
  
  <p>The JSONArray is dynamic, so sometimes it is the 73rd, 74th, or 75th object in the array and none of the objects in the array have names.  I am currently using this code to parse it.  It works fine when my particular object is in the 75th position, but crashes when it is not.  </p>
  
  <pre><code>try {
           JSONArray json = JSONfunctions2.getJSONfromURL("http://bitcoincharts.com/t/markets.json");
           JSONObject  forex = json.getJSONObject(75);
           String btc = forex.getString("avg");            
           currencyBTC = Double.parseDouble(btc);  
   }catch(JSONException e)        {
       Log.e("log_tag", "Error parsing data "+e.toString());
   }       
  </code></pre>
  
  <p>is it possible for me to identify the object by it's attributes, since the objects in the array have no names? How can i resolve this issue? Thank you in advance.</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p>This somewhat works, but only returns the values from the last object in the array.  How do I handle this so that i can parse my particular object, and not just the last one? ...</p>
  
  <pre><code> try {
  JSONArray jArray = JSONfunctions2.getJSONfromURL("http://bitcoincharts.com/t/markets.json");
  String symbol = "mtgoxUSD";
  for (int i = 0; i &lt; jArray.length(); i++) {
      JSONObject forex = jArray.getJSONObject(i);
      String mtgoxUSD = forex.getString("symbol");
      if (mtgoxUSD == symbol) {
          String btc = forex.getString("avg");            
          double currencyBTC = Double.parseDouble(btc);
      }
  }
  } catch (Exception e) {
  Log.e("log_tag", "Error parsing data "+ e.toString());
  }
  </code></pre>