我在使用以下代码退出后尝试登录Facebook
currentSession = Session.getActiveSession();
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (currentSession != null) {
if (!currentSession.isClosed()) {
currentSession.closeAndClearTokenInformation();
btnLogout.setText("Login");
Toast.makeText(getApplicationContext(),
"Successfully logout", 1000).show();
Session.setActiveSession(null);
// clear your preferences if saved
} else {
Log.d("DEBUG", "IS CLOSED");
//m i need to implement login code here? if yes how??
}
} else {
currentSession = new Session(PostFaceBook.this);
Session.setActiveSession(currentSession);
btnLogout.setText("Login");
currentSession.closeAndClearTokenInformation();
Toast.makeText(getApplicationContext(),
"Successfully logout", 1000).show();
// clear your preferences if saved
}
}
});
所以我成功从Facebook退出。现在如何实现登录代码(具有发布权限)和哪里?