Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. private void GetFriendList() {
  2. // TODO Auto-generated method stub
  3. Session activeSession = Session.getActiveSession();
  4. new Request(
  5. activeSession,
  6. "me/taggable_friends",
  7. null,
  8. HttpMethod.GET,
  9. new Request.Callback() {
  10. public void onCompleted(Response response) {
  11. try
  12. { GraphObject go = response.getGraphObject();
  13. JSONObject jso = go.getInnerJSONObject();
  14. JSONArray data = jso.getJSONArray("data");
  15. for ( int i = 0; i < data.length(); i++ )
  16. {
  17. JSONObject json_obj = data.getJSONObject( i );
  18. String name23 = json_obj.getString("name");
  19. HashMap<String, String> friend = new HashMap<String, String>();
  20. friend.put(TAG_Friend_Name, name23);
  21. FriendList.add(friend);
  22. Log.e("Name response",""+name23);
  23. name = name23;
  24. // Toast.makeText(getApplicationContext(), "Name: " + name , Toast.LENGTH_LONG).show();
  25. }
  26. }
  27. catch ( Throwable t )
  28. {
  29. t.printStackTrace();
  30. }
  31. String name4 = response.toString();
  32. Log.e("Response ",""+name4);
  33. /*friend = new ArrayList<String>();
  34. friend.add(name);*/
  35. ListAdapter adapter = new SimpleAdapter(Next.this,
  36. FriendList,
  37. R.layout.friend_list_item,
  38. new String[] { TAG_Friend_Name, TAG_ID },
  39. new int[] { R.id.friendname_textview,
  40. R.id.friendid_textview });
  41. friendlist_listview.setAdapter(adapter);
  42. }
  43. }
  44. ).executeAsync();
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement