title: Facebook friends list for JSONArray to JSONObjects
body: <p>i'm using facebook graph api to get the current user friend list.
  <br> i have the right permissions to do it, and the returned JSON object return something like that:</p>
  
  <pre><code>{
  "data": [
  {
    "name": "name1", 
    "id": "11111"
  }, 
  {
    "name": "name2", 
    "id": "2222"
  }, 
  {
    "name": "name3", 
    "id": "33333"
  }], 
  "paging": {
  "next": "https://graph.facebook.com/613714903/friends?format=json&amp;limit=5000&amp;offset=5000&amp;__after_id=100003711723705"
  }
  }
  </code></pre>
  
  <p>to my understanding this is an JSONArray and each user name and id are a JSONObjects..
  i wrote this code to encode it:</p>
  
  <pre><code>FacebookFriend[] facebookFriends = null;        
      try {
  
              facebookResults = facebookResults.getJSONArray(0);
              facebookFriends = new FacebookFriend[facebookResults.length()];
              for (int i=0; i &lt; facebookResults.length(); i++)
              {
                  JSONObject json = new JSONObject(facebookResults.getJSONObject(i).toString());
                  facebookFriends[i].setuId(json.getString("id"));
                  facebookFriends[i].setProfilePicture(getProfilePicture(json.getString("id")));
                  facebookFriends[i].setGender(getGender(json.getString("id")));
              }               
  
          } catch (JSONException e) { 
              Log.e("Facebook Error", e.toString());          
              alert("Facebook Error", e.toString(),"ok");
          }
  </code></pre>
  
  <p>i get the following error:</p>
  
  <pre><code> org.json.JSONException: Value [] of type org.json.JSONArray cannot be converted to JSONObject 
  </code></pre>
  
  <p>i can't really understand why...</p>