Android Facebook SDK 4.0 external logout -
i've succesfully updated login code fb sdk 4.0. initially, used code logout facebook external dialog.
if (global.getactivesession() != null) { session.getactivesession().closeandcleartokeninformation(); } session.setactivesession(null);
but new fb sdk 4.0, there no way use this. i've tried using
loginmanager loginmanager = loginmanager.getinstance(); loginmanager.logout();
but got following error cannot explain.
@ com.facebook.internal.validate.sdkinitialized(validate.java:99) @ com.facebook.login.loginmanager.<init>(loginmanager.java:70) @ com.facebook.login.loginmanager.getinstance(loginmanager.java:81) @ com.ababab.abab_name_changed.common.util.commonutils.fblogout(commonutils.java:676)
loginmanager.getinstance().logout();
works me.
i think you'll have call
facebooksdk.sdkinitialize(getapplicationcontext());
before ask loginmanager logout.
Comments
Post a Comment