我正在使用Android Facebook API 4.0。单击共享窗口上的取消按钮时,会触发onSuccess()
功能,但应触发onCancel()
。这是一个错误吗?请帮我找到解决方案。
CallbackManager callbackManager;
ShareDialog shareDialog;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
shareDialog = new ShareDialog(this);
shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(){
// this function is calling when I Click cancel button
}
@Override
public void onCancel(){
}
@Override
public void onError(){
}
});
}