我怀疑的是,当我调用下面的方法时,值为null,当然,因为对象用户尚未填充,因为将填充在Facebook请求中。所以,问题是,我如何等待Facebook完成然后返回正确的用户群?
public ArrayList<User> getUsers(){
ArrayList<User> users = new ArrayList<User>();
User user = new User();
//It's not the complete code
Facebook.resquest(){
@Override
onComplete(){
for(int i = 0;i<10;i++){
users.add(user)
}
}
}
// The question is, what do i have to do for the below object 'll have the same value of user object inside facebook request?
return users;
}
答案 0 :(得分:0)
使用Request.executeAndWait(request);
。