Status
class Status : Parcelable, Result
Represents the results of work.
Summary
Constants |
|
|---|---|
const Parcelable.Creator<Status!>! |
Public constructors |
|---|
|
Creates a representation of the status resulting from a GoogleApiClient operation. |
Status(connectionResult: ConnectionResult, statusMessage: String)Creates a failed API call status due to a failure to connect to Google Play services. |
|
Creates a representation of the status resulting from a GoogleApiClient operation. |
Status(Creates a representation of the status resulting from a GoogleApiClient operation. |
Public functions |
|
|---|---|
Boolean |
|
PendingIntent? |
A pending intent to resolve the failure. |
Status! |
Returns the status of this result. |
Boolean |
Returns true if calling |
Int |
hashCode() |
Boolean |
Returns true if the operation was canceled. |
Boolean |
Returns true if the operation was interrupted. |
Boolean |
Returns true if the operation was successful. |
Unit |
startResolutionForResult(Resolves an error by starting any intents requiring user interaction. |
Unit |
startResolutionForResult(activity: Activity!, requestCode: Int)Resolves an error by starting any intents requiring user interaction. |
String! |
toString() |
Unit |
writeToParcel(out: Parcel!, flags: Int) |
Public properties |
|
|---|---|
ConnectionResult? |
|
Int |
|
String? |
Inherited functions |
||
|---|---|---|
|
Constants
Public constructors
Status
Status(statusCode: Int)
Creates a representation of the status resulting from a GoogleApiClient operation.
| Parameters | |
|---|---|
statusCode: Int |
The status code. |
Status
Status(connectionResult: ConnectionResult, statusMessage: String)
Creates a failed API call status due to a failure to connect to Google Play services.
Status
Status(statusCode: Int, statusMessage: String?)
Creates a representation of the status resulting from a GoogleApiClient operation.
Status
Status(
statusCode: Int,
statusMessage: String?,
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 functions
getResolution
fun getResolution(): PendingIntent?
A pending intent to resolve the failure. This intent can be started with startIntentSenderForResult to present UI to solve the issue.
| Returns | |
|---|---|
PendingIntent? |
The pending intent to resolve the failure. |
getStatus
@CanIgnoreReturnValue
fun getStatus(): Status!
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.
hasResolution
fun hasResolution(): Boolean
Returns true if calling startResolutionForResult will start any intents requiring user interaction.
| Returns | |
|---|---|
Boolean |
true if there is a resolution that can be started. |
isSuccess
@CheckReturnValue
fun isSuccess(): Boolean
Returns true if the operation was successful.
| Returns | |
|---|---|
Boolean |
true if the operation was successful, false if there was an error. |
startResolutionForResult
fun startResolutionForResult(
activityResultLauncher: ActivityResultLauncher<IntentSenderRequest!>!
): Unit
Resolves an error by starting any intents requiring user interaction. See SIGN_IN_REQUIRED, and RESOLUTION_REQUIRED.
| Parameters | |
|---|---|
activityResultLauncher: ActivityResultLauncher<IntentSenderRequest!>! |
The |
startResolutionForResult
fun startResolutionForResult(activity: Activity!, requestCode: Int): Unit
Resolves an error by starting any intents requiring user interaction. See SIGN_IN_REQUIRED, and RESOLUTION_REQUIRED.
This method follows the startActivityForResult and onActivityResult API pattern. Consider migrating to startResolutionForResult as the API is the recommended approach.
| 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 |
requestCode: Int |
The request code to pass to onActivityResult. |
| Throws | |
|---|---|
android.content.IntentSender.SendIntentException |
If the resolution intent has been canceled or is no longer able to execute the request. |