目录

CLASS info
public final class Status extends Result implements Parcelable
Represents the task processing result.

Constant Summary

TypeNameDesc
StatusCreator< Scope >CREATORThe creator attribute that is mandatory for implementing the Parcelable API.
StatusSUCCESSStatus indicating a successful operation.
StatusFAILUREStatus indicating a failed operation.
StatusMessageNotFound Status of 404, indicating no resource found.
StatusCoreException Status of 500, indicating internal server error.

Public Constructor Summary

Constructor name
public Status(int code)
Creates a status based on the task processing result.
public Status(int statusCode, String statusMessage)
Creates a representation of the status based on the task processing result.
public Status(int statusCode, String statusMessage, PendingIntent pendingIntent)
Creates a representation of the status based on the task processing result.

Public Method Summary

Return typeMethod name
Stringpublic int getStatusCode()
booleanpublic String getStatusMessage()
intpublic PendingIntent getResolution()
voidpublic boolean isSuccess()
int public boolean hasResolution()
Stringpublic void startResolutionForResult(Activity activity, int requestCode)
booleanpublic boolean equals(Object o) ()
intpublic int describeContents()
voidpublic void writeToParcel(Parcel parcel, int i)
int public final int hashCode()
Stringpublic final String toString()

Constants

Constant
public static final StatusCreator< Scope > CREATOR
The creator attribute that is mandatory for implementing the Parcelable API.
Constant
public static final Status SUCCESS
Status indicating a successful operation.
Constant Value: new Status(0)
Constant
public static final Status FAILURE
Status indicating a failed operation.
Constant Value: new Status(1)
Constant
public static final Status MessageNotFound
Status of 404, indicating no resource found.
Constant Value: new Status(404)
Constant
public static final Status CoreException
Status of 500, indicating internal server error.
Constant Value: new Status(500)

Public Constructors

constructor
public Status(int code)
Creates a status based on the task processing result.

Parameters

Parameter nameParameter desc
codeStatus code:
0: success.
1: failure.
404: no resource found.
500: internal error.
constructor
public Status(int statusCode, String statusMessage)
Creates a representation of the status based on the task processing result.

Parameters

Parameter nameParameter desc
statusCodeStatus code:
0: success.
1: failure.
404: no resource found.
500: internal error.
statusMessageStatus description.
constructor
public Status(int statusCode, String statusMessage, PendingIntent pendingIntent)
Creates a representation of the status based on the task processing result.

Parameters

Parameter nameParameter desc
statusCodeStatus code:
0: success.
1: failure.
404: no resource found.
500: internal error.
statusMessageStatus description.
pendingIntent Pending intent that will resolve the issue through user interaction.

Public Methods

Method
public int getStatusCode()
Obtains the status code.

Return

typedesc
intStatus code:
0: success.
1: failure.
404: no resource found.
500: internal error.
Method
public String getStatusMessage()
Obtains the error description.

Return

typedesc
StringStatus description.
Method
public PendingIntent getResolution()
Obtains the pending intent to resolve the failure.

Return

typedesc
PendingIntentPending intent that can resolve the issue. This intent can be started with the startResolutionForResult method to present UI to resolve the issue.
Method
public boolean isSuccess()
Checks whether the status is success.

Return

typedesc
booleantrue for a task processing success, and false for a task processing failure.
Method
public boolean hasResolution()
Checks whether there is a pending intent that will resolve the issue. If true is returned, startResolutionForResult can be called to enable the pending intent, which will resolve the failure through user interaction.

Return

typedesc
booleanReturns true if any resolution intent is available.
Method
public void startResolutionForResult(Activity activity, int requestCode)
Starts a pending intent to resolve a failure through user interaction.

Parameters

Parameter nameParameter desc
activityActivity context used to resolve the issue. The activity’s onActivityResult method will be called after the user is done. If the resultCode indicates a success, another connection can be requested.
requestCodeRequest code passed to onActivityResult.
Method
public boolean equals(Object o)
Method
public int describeContents()
Method
public void writeToParcel(Parcel parcel, int i)
Method
public final int hashCode()
Method
public final String toString()