如何使用发布权限重新登录facebook

时间:2015-03-14 06:53:59

标签: android android-facebook facebook-sdk-3.0

我在使用以下代码退出后尝试登录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退出。现在如何实现登录代码(具有发布权限)和哪里?

0 个答案:

没有答案