title: How to get multiple specific values from a key in a JSON Object
body: <p>So right now I am trying to get information from the logged in user through Facebook graph api.</p>
  
  <pre><code>{"id":"10202628284866677","name":"Rohit Tigga","link":"https:\/\/www.facebook.com\/app_scoped_user_id\/10202628284866677\/","picture":{"data":{"is_silhouette":false,"url":"https:\/\/fbcdn-profile-a.akamaihd.net\/hprofile-ak-xta1\/v\/t1.0-1\/p200x200\/10438582_10202555461926149_8285465463541146116_n.jpg?oh=283ec503c6eb051aad077366155c621d&amp;oe=55E6E24B&amp;__gda__=1445616180_3110e5bf89e9f3050fe623b86d47618b"}},"friends":{"data":[{"name":"Arthur Shir","id":"10153237510764181"},{"name":"Kanye East","id":"1454465268197338"}],"paging":{"next":"https:\/\/graph.facebook.com\/v2.3\/10202628284866677\/friends?access_token=CAAWKvUHZCc2sBAHDCZCfL1dHLcrrMoqNxHJSXun5vm1iJQlMxaF43ZCTvIj4Oo4sHeRstTEACDpDz45wLj9FwXBXkoqxPyBQvjcQKY4ZCPgEqhcPdyPb3JepOA1KCADTt2ZBIO8NRX8QKdrlvSWxxgEfSH6SY94nUsLZBRslP8OjJ9r9DYm6kih8GwJ7la0w30KbZAi3AFNOUx1FDU9Y38S&amp;limit=25&amp;offset=25&amp;__after_id=enc_AdB7OPjfCizP7TWz68NToMvADpaegj9bV3w8g22S1dgcGTiHSRUC2xQr2uhJDdQczRtmkKPQS9fzh0Fq7LgWLZAsu"},"summary":{"total_count":1289}}}
  </code></pre>
  
  <p>I was able to get the id, name, profile_pic_url </p>
  
  <pre><code>GraphRequest request = GraphRequest.newMeRequest(
                                  loginResult.getAccessToken(),
                                  new GraphRequest.GraphJSONObjectCallback() {
                                      @Override
                                      public void onCompleted(
                                              JSONObject object,
                                              GraphResponse response) {
                                          // Application code
                                          response.getError();
                                          //Here's what you got
                                          Log.e("JSON:", object.toString());
  
                                          //Find out how to store all user friends efficiently
  
                                          try {
                                              user_id=object.getString("id");
                                              name=object.getString("name");
                                              profile=object.getString("link");
                                              profile_pic_url = object.getString("picture");
                                              friends = object.getString("friends");
  
  
                                              JSONObject pic_object1= (JSONObject) new JSONTokener(profile_pic_url).nextValue();
                                              JSONObject pic_object2 = pic_object1.getJSONObject("data");
                                              profile_pic_url = (String) pic_object2.get("url");
  </code></pre>
  
  <p>I am more specifically trying to get the ID of each facebook friend from the logged in user. It is from this portion which I have as a string now. </p>
  
  <pre><code> {"data":[{"name":"Arthur Shir","id":"10153237510764181"},{"name":"Kanye East","id":"1454465268197338"}],"paging":{"next":"https:\/\/graph.facebook.com\/v2.3\/10202628284866677\/friends?access_token=CAAWKvUHZCc2sBAHDCZCfL1dHLcrrMoqNxHJSXun5vm1iJQlMxaF43ZCTvIj4Oo4sHeRstTEACDpDz45wLj9FwXBXkoqxPyBQvjcQKY4ZCPgEqhcPdyPb3JepOA1KCADTt2ZBIO8NRX8QKdrlvSWxxgEfSH6SY94nUsLZBRslP8OjJ9r9DYm6kih8GwJ7la0w30KbZAi3AFNOUx1FDU9Y38S&amp;limit=25&amp;offset=25&amp;__after_id=enc_AdB7OPjfCizP7TWz68NToMvADpaegj9bV3w8g22S1dgcGTiHSRUC2xQr2uhJDdQczRtmkKPQS9fzh0Fq7LgWLZAsu"},"summary":{"total_count":1289}}
  </code></pre>
  
  <p>I am trying to iterate through the JSON Object and store every id in an array. </p>
  
  <p>But I have been unsuccessful in my attempts. </p>
  
  <p>I am looking at this, yet no luck :/</p>
  
  <p><a href="https://stackoverflow.com/questions/9151619/java-iterate-over-jsonobject">How to iterate over a JSONObject?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12870332/how-can-i-iterate-jsonobject-to-get-individual-items">How can I iterate JSONObject to get individual items</a></p>
  
  <p>How should I go about doing this? </p>