title: How to parse a JSON and turn its values into an Array?
body: <pre><code>public static void parseProfilesJson(String the_json){
         try {
              JSONObject myjson = new JSONObject(the_json);
  
              JSONArray nameArray = myjson.names();
              JSONArray valArray = myjson.toJSONArray(nameArray);
              for(int i=0;i&lt;valArray.length();i++)
              {
                  String p = nameArray.getString(i) + "," + ValArray.getString(i);
                  Log.i("p",p);
              }       
  
          } catch (JSONException e) {
                  e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>As you can see, this sample code will print out the <strong>KEY</strong> of the JSONs, followed by the <strong>VALUES</strong> of the JSONS.</p>
  
  <p>It would print <strong>profiles, john</strong> if the json was like this:</p>
  
  <pre><code>{'profiles':'john'}
  </code></pre>
  
  <p>That's cool. That's fine, as I can work with those variables. However, what if the JSON was like this:</p>
  
  <pre><code>{'profiles': [{'name':'john', 'age': 44}, {'name':'Alex','age':11}]}
  </code></pre>
  
  <p>In this case, the entire value would be the array. Basically, I just want to grab that array (which is the "value" in this case)...and turn it into an actual array that JAVA could use.  How can I do that? Thanks.</p>