Facebook SDK 4 for Android – how to log out programmatically

You can use LoginManager.getInstance().logOut();, even if you use LoginButton because

This UI element wraps functionality available in the LoginManager.

EDIT:
Just to mention that this works for Facebook SDK v4. I don’t know if they will change it in the future.

@as batoutofhell mention, don’t forget to put FacebookSdk.sdkInitialize(getApplicationContext()); to initialize the facebook sdk. Please see here for the details.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)