Android - Clear Facebook access token

后端 未结 6 744
隐瞒了意图╮
隐瞒了意图╮ 2021-01-16 07:32

I have a SettingsActivity where there are several options including finding Facebook friends and logging out. So when a user chooses to find her Facebook friend

6条回答
  •  囚心锁ツ
    2021-01-16 08:19

    private Session.StatusCallback statusCallback = new SessionStatusCallback();
    
    logout.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View arg0) {
    Session.openActiveSession(this, true, statusCallback);  
    }
    });
    
    private class SessionStatusCallback implements Session.StatusCallback {
    @Override
    public void call(Session session, SessionState state,
    Exception exception) {
    session.closeAndClearTokenInformation();    
    }
    }
    

提交回复
热议问题