public final class

Status

extends Object
implements Parcelable Result Parcelable
java.lang.Object
   ↳ com.google.android.gms.common.api.Status

Class Overview

Represents the results of work.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<Status> CREATOR
Public Constructors
Status(int statusCode)
Creates a representation of the status resulting from a GoogleApiClient operation.
Status(int statusCode, String statusMessage)
Creates a representation of the status resulting from a GoogleApiClient operation.
Status(int statusCode, String statusMessage, PendingIntent pendingIntent)
Creates a representation of the status resulting from a GoogleApiClient operation.
Public Methods
boolean equals(Object obj)
PendingIntent getResolution()
A pending intent to resolve the failure.
Status getStatus()
Returns the status of this result.
int getStatusCode()
Indicates the status of the operation.
String getStatusMessage()
boolean hasResolution()
Returns true if calling startResolutionForResult(Activity, int) will start any intents requiring user interaction.
int hashCode()
boolean isCanceled()
Returns true if the operation was canceled.
boolean isInterrupted()
Returns true if the operation was interrupted.
boolean isSuccess()
Returns true if the operation was successful.
void startResolutionForResult(Activity activity, int requestCode)
Resolves an error by starting any intents requiring user interaction.
String toString()
void writeToParcel(Parcel out, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface com.google.android.gms.common.api.Result

Fields

public static final Creator<Status> CREATOR

Public Constructors

public Status (int statusCode)

Creates a representation of the status resulting from a GoogleApiClient operation.

Parameters
statusCode int: The status code.

public Status (int statusCode, String statusMessage)

Creates a representation of the status resulting from a GoogleApiClient operation.

Parameters
statusCode int: The status code.
statusMessage String: The message associated with this status, or null.

public Status (int statusCode, String statusMessage, PendingIntent pendingIntent)

Creates a representation of the status resulting from a GoogleApiClient operation.

Parameters
statusCode int: The status code.
statusMessage String: The message associated with this status, or null.
pendingIntent PendingIntent: A pending intent that will resolve the issue when started, or null.

Public Methods

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public PendingIntent getResolution ()

A pending intent to resolve the failure. This intent can be started with startIntentSenderForResult(IntentSender, int, Intent, int, int, int) to present UI to solve the issue.

Returns
PendingIntent The pending intent to resolve the failure.

public Status getStatus ()

Returns the status of this result. Use isSuccess() to determine whether the call was successful, and getStatusCode() to determine what the error cause was.

Certain errors are due to failures that can be resolved by launching a particular intent. The resolution intent is available via getResolution().

Returns
Status

public int getStatusCode ()

Indicates the status of the operation.

Returns
int Status code resulting from the operation. The value is one of the constants in CommonStatusCodes or specific to the APIs added to the GoogleApiClient.

public String getStatusMessage ()

Returns
String

public boolean hasResolution ()

Returns true if calling startResolutionForResult(Activity, int) will start any intents requiring user interaction.

Returns
boolean true if there is a resolution that can be started.

public int hashCode ()

Returns
int

public boolean isCanceled ()

Returns true if the operation was canceled.

Returns
boolean

public boolean isInterrupted ()

Returns true if the operation was interrupted.

Returns
boolean

public boolean isSuccess ()

Returns true if the operation was successful.

Returns
boolean true if the operation was successful, false if there was an error.

public void startResolutionForResult (Activity activity, int requestCode)

Resolves an error by starting any intents requiring user interaction. See SIGN_IN_REQUIRED, and RESOLUTION_REQUIRED.

Parameters
activity Activity: An Activity context to use to resolve the issue. The activity's onActivityResult method will be invoked after the user is done. If the resultCode is RESULT_OK, the application should try to connect again.
requestCode int: The request code to pass to onActivityResult.
Throws
IntentSender.SendIntentException If the resolution intent has been canceled or is no longer able to execute the request.

public String toString ()

Returns
String

public void writeToParcel (Parcel out, int flags)

Parameters
out Parcel
flags int