我有一个简单的登录按钮,在我的oncreate中做了以下操作:
mLoginButton = (LoginButton)findViewById(R.id.connect_facebook_button);
mLoginButton.setApplicationId(.getResources().getString(R.string.app_id));
mLoginButton.setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
public void onUserInfoFetched(GraphUser user) {
setUser(user); // Just sets mUser to be this user
try {
Toast.makeText(this, mUser.getFirstName(), Toast.LENGTH_SHORT).show();
} catch (Exception FacebookException) {
FacebookException.printStackTrace();
}
}
});
所有的操作都已成功执行,包括onUserInfoFetched。
问题是,在每个实例中,我的Graphuser用户为空。
我的appID是正确的,我的android哈希值是他们给我的调试版本(在样本应用程序上测试过,运行良好),登录屏幕确实弹出……不太确定接下来该怎么做。
另外,如果我按两次按钮,就会出现错误:
an attempt was made to open a session that has a pending request