I've been reading and haven't found a solution yet. So here goes.
I'm trying to upgrade to Facebook's new SDK 4.1 Android SDK. I can successfully log in a user using the Facebook's LoginButton using this code: facebookLogin.registerCallback(callbackManager, new FacebookCallback<LoginResult>()....
Once a user is logged in, I want to know when a user logs using the same button. The login button changes to say "Log out" when a user is logged in. What I want to know, is how can I listen for a successful log out from the LoginButton? ( I know thatLoginManager.getInstance().logOut();
can log a user out. But what I'm looking for is some sort of callBack which I can handle accordingly.)
Quoting the Facebook SDK Upgrading the Android SDK from 4.0.1 to 4.1.0 docs: "Replacement Classes - Session and UserSettingsFragment have been removed and replaced by the LoginManager and AccessToken classes. LoginActivity is replaced by FacebookActivity."
Because I wanted to mimic the old Sessions changed listener logic, I looked further into the AccessTokenTracker. Here's how I solved my problem. I still use Facebook's LoginButton to Log out the user, but I also include this to listen for a change to a null token. Meaning the user logged out.
Hope this helps others in the future.