Question Detail

How to logout from Facebook Graph API in android?

6 years ago Views 1549 Visit Post Reply

On my Login page where Facebook and Local Login Options, Local and Facebook Login working fine and Local Logout from SecondActivity also working but I am not able to log out from facebook when I Login with Facebook it login button Text convert as Logout and I entered in Second Activity. When I click on Logout facebook logout text remain and auto working to log in again. and Login to Second Activity. 

How can I log out of facebook session?


Thread Reply

Hemant Sharma

- 6 years ago

It will log out your Facebook Profile

SecondActivity.java

logoutBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FacebookSdk.sdkInitialize(getApplicationContext());
                LoginManager.getInstance().logOut();
            }
        });