简体   繁体   中英

Logout Facebook Android SDK

I use the LoginButton from the Facebook Android SDK to login to my application. How do I programmatically log out the user from any Activity?

启动Facebook SDK 4.0,您需要调用

LoginManager.getInstance().logOut();

If you are using facebook SDK 4, you first need to initialize sdk:

FacebookSdk.sdkInitialize(getApplicationContext());

And then just do:

LoginManager.getInstance().logOut();

See here for more details.

If you are using facebook SDK 4, you first need to initialize sdk:

FacebookSdk.sdkInitialize(getApplicationContext());

And then :

 LoginManager.getInstance().logOut();

 AccessToken.setCurrentAccessToken(null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM