Status

class Status 
: Parcelable 
, Result 

Represents the results of work.

Summary

Constants

const Parcelable.Creator < Status !>!

Public constructors

Status (statusCode:  Int )

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.

Status (statusCode:  Int , statusMessage:  String ?)

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

Status (
    statusCode:  Int ,
    statusMessage:  String ?,
    pendingIntent:  PendingIntent ?
)

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

Public functions

Boolean
equals (obj:  Any ?)
PendingIntent ?

A pending intent to resolve the failure.

Status !

Returns the status of this result.

Boolean

Returns true if calling startResolutionForResult will start any intents requiring user interaction.

Int
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 (
    activityResultLauncher:  ActivityResultLauncher < IntentSenderRequest !>!
)

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 !
Unit
writeToParcel (out:  Parcel !, flags:  Int )

Inherited functions

Constants

CREATOR

const val  CREATOR 
 Parcelable.Creator 
< Status 
!>!

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.

Parameters
statusCode:  Int

The status code.

statusMessage:  String ?

The message associated with this status, or null.

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

equals

fun  equals 
(obj:  Any 
?):  Boolean 

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.

hashCode

fun  hashCode 
():  Int 

isCanceled

fun  isCanceled 
():  Boolean 

Returns true if the operation was canceled.

isInterrupted

fun  isInterrupted 
():  Boolean 

Returns true if the operation was interrupted.

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 androidx.activity.result.ActivityResultLauncher to invoke when the error resolution, if any, completes.

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 RESULT_OK , the application should try to connect again.

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.

toString

fun  toString 
():  String 
!

writeToParcel

fun  writeToParcel 
(out:  Parcel 
!, flags:  Int 
):  Unit 

Public properties

connectionResult

val  connectionResult 
 ConnectionResult 
?

statusCode

val  statusCode 
 Int 

statusMessage

val  statusMessage 
 String 
?
Create a Mobile Website
View Site in Mobile | Classic
Share by: