FacebookCallback.onCancel is getting called when trying to login using facebook sdk FacebookCallback.onCancel is getting called when trying to login using facebook sdk android android

FacebookCallback.onCancel is getting called when trying to login using facebook sdk


yes i was facing the same issue, resolved it by using the below code just before login

 LoginManager.getInstance().logOut();


The reason behind this behaviour is that you are already logged in. So when you revoke it, oncancel() gets called instead of onsubmit(). So just perform logout on your application's logout button like this

Import -->

import com.facebook.login.LoginManager;

Implementation -->

LoginManager.getInstance().logOut();


I had the same issue, eventually I found the problem. The activity calling facebook login fragment had android:launchMode="singleInstance" in the manifest file.