我的问题是,在用facebook登录两次后,登录管理器没有响应。我的意思是我可以登录并注销两次,但只有facebook微调器出现后才会发生任何事情。我试图找出问题所在,我认为当我尝试为登录管理器注册回调时,它没有得到响应。不会调用任何函数(onSucces,onCancel,onError)。
Facebook登录
private void facebookLogin()
{
LoginManager.getInstance().logInWithReadPermissions(LogInActivity.this, Arrays.asList("email"));
Toast.makeText(LogInActivity.this,"asd0000",Toast.LENGTH_SHORT).show();
LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
Toast.makeText(LogInActivity.this,"asd2",Toast.LENGTH_SHORT).show();
handleFacebookAccessToken(loginResult.getAccessToken());
Toast.makeText(LogInActivity.this,"asd11",Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
Toast.makeText(LogInActivity.this,"Log in was canceled!",Toast.LENGTH_SHORT).show();
}
@Override
public void onError(FacebookException error) {
Toast.makeText(LogInActivity.this,"Error" + error.getMessage(),Toast.LENGTH_SHORT).show();
}
});
}
onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mCallbackManager.onActivityResult(requestCode, resultCode, data);
}
我在onCreate中初始化回调管理器。
错误
E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zerolength