-
- All Implemented Interfaces:
-
com.facebook.FacebookDialog,com.facebook.share.Sharer
public final class ShareDialog extends FacebookDialogBase<ShareContent, Sharer.Result> implements Sharer
Provides functionality to share content via the Facebook Share Dialog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumShareDialog.ModeThe mode for the share dialog.
-
Field Summary
Fields Modifier and Type Field Description public final static StringWEB_SHARE_DIALOGprivate booleanshouldFailOnDataError
-
Constructor Summary
Constructors Constructor Description ShareDialog(Activity activity)Constructs a new ShareDialog. ShareDialog(Fragment fragment)Constructs a new ShareDialog. ShareDialog(Fragment fragment)Constructs a new ShareDialog.
-
Method Summary
Modifier and Type Method Description booleangetShouldFailOnDataError()Specifies whether the sharer should fail if it finds an error with the share content. 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 com.facebook.share.model.ShareContent using the providedActivity. static voidshow(Fragment fragment, ShareContent shareContent)Helper to show the provided com.facebook.share.model.ShareContent using the providedFragment. static voidshow(Fragment fragment, ShareContent shareContent)Helper to show the provided com.facebook.share.model.ShareContent using the providedFragment. static booleancanShow(Class<out ShareContent> contentType)Indicates whether it is possible to show the dialog for 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. 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, getRequestCode, registerCallback, registerCallback, setCallbackManager, show -
Methods inherited from class com.facebook.FacebookDialog
show -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ShareDialog
ShareDialog(Activity activity)
Constructs a new ShareDialog.- Parameters:
activity- Activity to use to share the provided content.
-
ShareDialog
ShareDialog(Fragment fragment)
Constructs a new ShareDialog.- Parameters:
fragment- androidx.fragment.app.Fragment to use to share the provided content.
-
ShareDialog
ShareDialog(Fragment fragment)
Constructs a new ShareDialog.- Parameters:
fragment- android.app.Fragment to use to share the provided content.
-
-
Method Detail
-
getShouldFailOnDataError
boolean getShouldFailOnDataError()
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.
-
setShouldFailOnDataError
void setShouldFailOnDataError(boolean shouldFailOnDataError)
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.
- Parameters:
shouldFailOnDataError- whether the dialog should fail if it finds an error.
-
show
static void show(Activity activity, ShareContent shareContent)
Helper to show the provided com.facebook.share.model.ShareContent using the providedActivity. No callback will be invoked.
- Parameters:
activity- Activity to use to share the provided contentshareContent- Content to share
-
show
static void show(Fragment fragment, ShareContent shareContent)
Helper to show the provided com.facebook.share.model.ShareContent using the providedFragment. No callback will be invoked.
- Parameters:
fragment- androidx.fragment.app.shareContent- Content to share
-
show
static void show(Fragment fragment, ShareContent shareContent)
Helper to show the provided com.facebook.share.model.ShareContent using the providedFragment. No callback will be invoked.
- Parameters:
fragment- android.app.shareContent- Content to share
-
canShow
static boolean canShow(Class<out ShareContent> contentType)
Indicates whether it is possible to show the dialog for of the specified type.
- Parameters:
contentType- Class of the intended com.facebook.share.model.ShareContent toshare.
-
canShow
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
-
show
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
-
-
-
-