我检查了一些类似于我的问题,并且知道我的Override方法可能有问题,但我无法找到问题所在。在主要活动中我覆盖了onActivityReslut:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebookLoginPlugin.onActivityResult(requestCode, resultCode, data);
}
facebookLoginPlugin是类FBLogin的实例;
facebookLoginPlugin = new FBLogin(this);
在FBLogin中我像这样调用onActivityResult:
public void onActivityResult(int requestCode,int resultCode,Intent data)
{
uiHelper.onActivityResult(requestCode, requestCode, data);
Session session = Session.getActiveSession();
session.onActivityResult(activity, requestCode, resultCode, data);
Log.i(TAG,"onActivityResult ====="+session.isOpened()+" "+session.isClosed());
String status = getStatus(0);
Log.i(TAG,"status of facebook now is "+status);
Log.i(TAG,"resultCode ="+resultCode);
}
但是当我登录到facebook时,我得到了session.isOpend()== false,现在状态是"操作",我确信keyhash和appid可以用于sampleHellofacebook,并且我登录应用程序的仪表板工具,请帮助,谢谢。