Android 注销时禁用Facebook SDK 4.0中的共享按钮
我实现了hello facebook示例,在某些方面我感到困惑 首先,当我在Android Studio的real设备上测试该应用程序时,已经从已经登录的facebook应用程序中启用了“更新后”按钮(可能) 当我按应用程序的facebook登录按钮正常登录时,会显示个人资料图片和姓名。但是为什么我注销时共享按钮仍然处于启用状态Android 注销时禁用Facebook SDK 4.0中的共享按钮,android,facebook,facebook-graph-api,share-button,Android,Facebook,Facebook Graph Api,Share Button,我实现了hello facebook示例,在某些方面我感到困惑 首先,当我在Android Studio的real设备上测试该应用程序时,已经从已经登录的facebook应用程序中启用了“更新后”按钮(可能) 当我按应用程序的facebook登录按钮正常登录时,会显示个人资料图片和姓名。但是为什么我注销时共享按钮仍然处于启用状态 private void updateUI() { boolean enableButtons = AccessToken.getCurrentAccessT
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 {
我应该把postStatusUpdateButton.setEnabled(false)放在这里吗
“共享”按钮不要求用户(通过应用程序)登录才能共享。它要么切换到Facebook应用程序,要么弹出网络视图。无论哪种情况,他们都可以登录Facebook,而无需通过你的应用程序登录 这就是为什么它从未被禁用,即使没有访问令牌
profilePictureView.setProfileId(null);
greeting.setText(null);
}
}