Android SDK Version
All Implemented Interfaces:

public final class ShareDialog
extends com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>
implements Sharer
Provides functionality to share content via the Facebook Share Dialog
Nested Class Summary
Modifier and TypeClass and Description
static class ShareDialog.Mode
The mode for the share dialog.
Nested classes/interfaces inherited from class com.facebook.internal.FacebookDialogBase
com.facebook.internal.FacebookDialogBase.ModeHandler
Nested classes/interfaces inherited from interface com.facebook.share.
Sharer.Result
Field Summary
Modifier and TypeField and Description
static java.lang.StringWEB_SHARE_DIALOG 
Fields inherited from class com.facebook.internal.FacebookDialogBase
BASE_AUTOMATIC_MODE
Constructor Summary
Constructor and Description
ShareDialog(Activity activity)
Constructs a new ShareDialog.
ShareDialog(android.app.Fragment fragment)
Constructs a new ShareDialog.
ShareDialog(Fragment fragment)
Constructs a new ShareDialog.
Method Summary
Modifier and TypeMethod and Description
static booleancanShow(java.lang.Class<? extends ShareContent> contentType)
Indicates whether it is possible to show the dialog for ShareContent of the specified type.
booleancanShow(ShareContent content, ShareDialog.Mode mode)
Call this to check if the Share Dialog can be shown in a specific mode.
protected com.facebook.internal.AppCallcreateBaseAppCall() 
protected java.util.List<com.facebook.internal.FacebookDialogBase.ModeHandler>getOrderedModeHandlers() 
booleangetShouldFailOnDataError()
Specifies whether the sharer should fail if it finds an error with the share content.
protected voidregisterCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager, FacebookCallback<Sharer.Result> callback) 
voidsetShouldFailOnDataError(boolean shouldFailOnDataError)
Specifies whether the sharer should fail if it finds an error with the share content.
static voidshow(Activity activity, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Activity.
static voidshow(android.app.Fragment fragment, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment.
static voidshow(Fragment fragment, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment.
voidshow(ShareContent content, ShareDialog.Mode mode)
Call this to show the Share Dialog in a specific mode
Methods inherited from class com.facebook.internal.FacebookDialogBase
canShow, canShowImpl, getActivityContext, getRequestCode, registerCallback, registerCallback, setRequestCode, show, showImpl, startActivityForResult
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail

WEB_SHARE_DIALOG

public static final java.lang.String WEB_SHARE_DIALOG
Constructor Detail

ShareDialog

public ShareDialog(Activity activity)
Constructs a new ShareDialog.
Parameters:
activity - Activity to use to share the provided content.

ShareDialog

public ShareDialog(Fragment fragment)
Constructs a new ShareDialog.
Parameters:
fragment - android.support.v4.app.Fragment to use to share the provided content.

ShareDialog

public ShareDialog(android.app.Fragment fragment)
Constructs a new ShareDialog.
Parameters:
fragment - android.app.Fragment to use to share the provided content.
Method Detail

show

public static void show(Activity activity,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Activity. No callback will be invoked.
Parameters:
activity - Activity to use to share the provided content
shareContent - Content to share

show

public static void show(Fragment fragment,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment. No callback will be invoked.
Parameters:
fragment - android.support.v4.app.Fragment to use to share the provided content
shareContent - Content to share

show

public static void show(android.app.Fragment fragment,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment. No callback will be invoked.
Parameters:
fragment - android.app.Fragment to use to share the provided content
shareContent - Content to share

canShow

public static boolean canShow(java.lang.Class<? extends ShareContent> contentType)
Indicates whether it is possible to show the dialog for ShareContent of the specified type.
Parameters:
contentType - Class of the intended ShareContent to share.
Returns:
True if the specified content type can be shown via the dialog

registerCallbackImpl

protected void registerCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager,
                                    FacebookCallback<Sharer.Result> callback)
Specified by:
registerCallbackImpl in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>

getShouldFailOnDataError

public boolean getShouldFailOnDataError()
Description copied from interface: Sharer
Specifies whether the sharer should fail if it finds an error with the share content. If false, the share dialog will still be displayed without the data that was mis-configured. For example, an invalid placeID specified on the shareContent would produce a data error.
Specified by:
Returns:
A Boolean value.

setShouldFailOnDataError

public void setShouldFailOnDataError(boolean shouldFailOnDataError)
Description copied from interface: Sharer
Specifies whether the sharer should fail if it finds an error with the share content. If false, the share dialog will still be displayed without the data that was mis-configured. For example, an invalid placeID specified on the shareContent would produce a data error.
Specified by:
Parameters:
shouldFailOnDataError - whether the dialog should fail if it finds an error.

canShow

public boolean canShow(ShareContent content,
                       ShareDialog.Mode mode)
Call this to check if the Share Dialog can be shown in a specific mode.
Parameters:
mode - Mode of the Share Dialog
Returns:
True if the dialog can be shown in the passed in Mode

show

public void show(ShareContent content,
                 ShareDialog.Mode mode)
Call this to show the Share Dialog in a specific mode
Parameters:
mode - Mode of the Share Dialog

createBaseAppCall

protected com.facebook.internal.AppCall createBaseAppCall()
Specified by:
createBaseAppCall in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>

getOrderedModeHandlers

protected java.util.List<com.facebook.internal.FacebookDialogBase.ModeHandler> getOrderedModeHandlers()
Specified by:
getOrderedModeHandlers in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>