请任何人都可以告诉我为什么这段代码不返回结果?它总是停在
( if is.open())
并给出错误的。
com.facebook.Session.openActiveSession(this, true, new com.facebook.Session.StatusCallback() {
@Override
public void call(com.facebook.Session session, SessionState state,
Exception exception) {
// TODO Auto-generated method stub
if (session.isOpened()) {
// make request to the /me API
Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
TextView welcome = (TextView) findViewById(com.example.connectwithfacebook.R.id.textView1);
welcome.setText("Hello " + user.getName() + "!");
}
}
});
}
}
});
我实现了另一种方式,但我也遇到了同样的问题。