Skip to content Skip to sidebar Skip to footer

Android:cannot Logout From Facebook And Pass Status

Problem1:When i click login button i can log in,give status.but when i press logout button it does not logout.So,how will i logout from facebook? Problem2:I got a string str.I want

Solution 1:

just clear sharedprefrence and clear cookig to logout from facebook

btnFbLogout.setOnClickListener(newView.OnClickListener() {

    @OverridepublicvoidonClick(View v) {

        Log.d("Image Button", "button Clicked");
        Util.clearCookies(youractivity.this);

        // your sharedPrefrenceEditoreditor= context.getSharedPreferences("MYFB_TOKEN",    Context.MODE_PRIVATE).edit();
        editor.clear();
        editor.commit();
    }
});

OR

See this How can i logout from facebook when i click logout button

Solution 2:

use this it is working for me

facebook.logout(this);

in Facebook SDK Facebook.java

public String logout(Context context)throws MalformedURLException, IOException {
   Util.clearCookies(context);
   Bundleb=newBundle();
   b.putString("method", "auth.expireSession");
   Stringresponse= request(b);
   setAccessToken(null);
   setAccessExpires(0);
   return response;
}

Post a Comment for "Android:cannot Logout From Facebook And Pass Status"