0

我在与 Facebook 集成的 Android 应用程序中工作,但我遇到问题,因为每当我尝试注销 Facebook 并没有完全注销,

我搜索了很多,最后我使用了如下代码:

public Facebook mFacebook = new Facebook(APP_ID);
SessionStore.clear(logoutActivity.this);

try {
    mFacebook.logout(logoutActivity.this);
} catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

我尝试了上面的代码,但根本没有工作,Facebook 没有完全注销。有人可以帮帮我吗?

4

1 回答 1

0

这个五月对你有帮助...

Activity.mAsyncRunner.logout(this, new RequestListener() {
            public void onComplete(String response, Object state) {
                Log.d("Logout from Facebook", response);
                if (Boolean.parseBoolean(response) == true) {
                    // User successfully Logged out
                                Toast.makeText(getApplicationContext(), "Successfully logged out ", Toast.LENGTH_LONG).show();
                }
            } 
            public void onIOException(IOException e, Object state) {
            }               
            public void onFileNotFoundException(FileNotFoundException e,
                    Object state) {
            }

                public void onMalformedURLException(MalformedURLException e,
                        Object state) {
                }

                public void onFacebookError(FacebookError e, Object state) {
                }
            });

网址下方的示例

http://www.androidhive.info/2012/03/android-facebook-connect-tutorial/

于 2013-08-20T06:25:31.437 回答