I made one android app which will fetch all friends of logged in user of facebook.But it is not fetching all the friends.Can anyone tell what is the issue and help me with the correct process.Right now i am using the below code.
Request rt=Request.newMyFriendsRequest(session, new GraphUserListCallback() {
@Override
public void onCompleted(List<GraphUser> users, Response response) {
if(response.getError()==null){
ListIterator<GraphUser> graphUser=users.listIterator();
ArrayList<String> friends=new ArrayList<String>();
while(graphUser.hasNext()){
GraphUser friendObject=graphUser.next();
friends.add(friendObject.getName());
}
System.out.println(friends);
TextView listOfFriends=(TextView) findViewById(R.id.welcome);
listOfFriends.setText("hello"+friends);
}
else{
Toast.makeText(MainActivity.this, response.getError().getErrorMessage(), Toast.LENGTH_SHORT).show();
}
}
});
rt.executeAsync();
please suggest me what should i do?