0

I implemented the sample hello facebook and I m confused on some points.

First when I test the app in real device from Android Studio, the post update button is already enabled (possibly) from facebook app which is already logged in

When I login normally by pressing my app's facebook login button, profile picture and name shows up. BUT why when I logout the Share button is still enabled?

private void updateUI() {

    boolean enableButtons = AccessToken.getCurrentAccessToken() != null;

    postStatusUpdateButton.setEnabled(enableButtons || canPresentShareDialog);


    Profile profile = Profile.getCurrentProfile();
    if (enableButtons && profile != null) {
        profilePictureView.setProfileId(profile.getId());
        greeting.setText(getString(R.string.hello_user, profile.getLastName()));
    } else {

Shall I put here postStatusUpdateButton.setEnabled(false);

        profilePictureView.setProfileId(null);
        greeting.setText(null);
    }
}
4

1 回答 1

0

共享按钮不需要用户登录(通过您的应用程序)即可共享。它将切换到 Facebook 应用程序或弹出 web 视图。无论哪种情况,他们都可以登录 Facebook,而无需通过您的应用程序登录。

这就是为什么它永远不会被禁用,即使没有访问令牌。

于 2015-04-15T17:04:33.967 回答