How do I disable the Facebook share button?

Disable Share button in Facebook SDK 4.0 on Logout

  • 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); } }

  • Answer:

    The Share button does not require the user to be logged in (via your app) in order to share. It will either switch to the Facebook app or pop up a webview. In either case, they can log into Facebook without having to log in via your app. That's why it's never disabled, even if there's no access token.

user2629955 at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.