Class ShareResult
java.lang.Object
com.codename1.share.ShareResult
Outcome of a share request initiated through Display.share(String)
or ShareButton.
Status semantics:
SHARED_TO: the user picked a target and the system accepted the share.getPackageName()returns the chosen target's identifier: the Android package name (e.g.com.whatsapp) or, on iOS, theUIActivityType(e.g.com.apple.UIKit.activity.PostToTwitter).DISMISSED: the user cancelled the share sheet without picking a target.FAILED: the share could not be completed.getError()may carry a short, platform-supplied description (no stack traces).
Instances are immutable. Construct through the static factories.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUser dismissed/cancelled the share sheet.static final intShare could not be completed.static final intStatus of aShareResult. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShareResultBuild aDISMISSEDresult.static ShareResultBuild aFAILEDresult with an optional platform message.getError()Platform-supplied message whenisFailed()is true, otherwise null.Chosen target identifier when the user picked a destination, otherwise null.intbooleanTrue iff status ==STATUS_DISMISSED.booleanisFailed()True iff status ==STATUS_FAILED.booleanTrue iff status ==STATUS_SHARED_TO.static ShareResultBuild aSHARED_TOresult.toString()Returns a string representation of the object.
-
Field Details
-
STATUS_SHARED_TO
-
STATUS_DISMISSED
public static final int STATUS_DISMISSEDUser dismissed/cancelled the share sheet.- See Also:
-
STATUS_FAILED
public static final int STATUS_FAILEDShare could not be completed.- See Also:
-
-
Method Details
-
dismissed
Build aDISMISSEDresult. -
failed
Build aFAILEDresult with an optional platform message. -
getStatus
public int getStatus() -
isDismissed
public boolean isDismissed()True iff status ==STATUS_DISMISSED. -
isFailed
public boolean isFailed()True iff status ==STATUS_FAILED. -
getPackageName
Chosen target identifier when the user picked a destination, otherwise null. -
getError
Platform-supplied message whenisFailed()is true, otherwise null. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())