I've been looking for a solution for this about two days and cant seem to find it...
I've triend lots of things I even created an Global class that can receive the session the user got when logging in but it doents work... when I set for example, lblNotify, it receives the msg:
public void logoutProcess()
{
if (Global.facebookSession.getActiveSession() != null) {
Global.facebookSession.closeAndClearTokenInformation();
lblNotify.setText("found this session");
}
Global.facebookSession.setActiveSession(null);
}
But nothing happens, when I close the app and open it again my user is still logged in...
Also this is my global function
public class Global {
public static Session facebookSession;
public static String usuName;
}
That I'm setting onCreate of the MainActivity like that:
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
Global.facebookSession = new Session.Builder(this).build();
if (session.isOpened()) {
Request.newMeRequest(session, new Request.GraphUserCallback() {
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
Global.usuName = user.asMap().get("name").toString();
}
}
}).executeAsync();
}
}
});
Any idea?
Thanks!