Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ConfirmationActivity

open class ConfirmationActivity : Activity
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.view.ContextThemeWrapper
   ↳ android.app.Activity
   ↳ androidx.wear.activity.ConfirmationActivity

This Activity is used to display confirmation animations after the user completes an action on the wearable. There are three types of confirmations: Success: the action was completed successfully on the wearable. Failure: the action failed to complete. Open on Phone: the action has caused something to display on the phone, or in order to complete the action, the user will need to go to their phone to continue.

It is the responsibility of the wearable application developer to determine whether the action has succeeded, failed, or requires the user to go to their phone, and trigger the appropriate confirmation.

To configure the confirmation according to the result of the action, set the extra to one of the following values:

SUCCESS_ANIMATION
Displays a positive confirmation animation with an optional message.
OPEN_ON_PHONE_ANIMATION
Displays an animation indicating an action has been sent to a paired device.
FAILURE_ANIMATION
Displays a generic failure page with an optional message.
An optional message, included in the extra EXTRA_MESSAGE will be displayed horizontally centered below the animation.

Summary

Constants

static String

static String

static Int

static Int

static Int

Public constructors

This Activity is used to display confirmation animations after the user completes an action on the wearable.

Public methods

open Unit
onCreate(savedInstanceState: Bundle!)

Protected methods

open Unit

Override this method if you wish to provide different than out-of-the-box behavior when the confirmation animation finishes.

Constants

EXTRA_ANIMATION_TYPE

static val EXTRA_ANIMATION_TYPE: String
Value: "androidx.wear.activity.extra.ANIMATION_TYPE"

EXTRA_MESSAGE

static val EXTRA_MESSAGE: String
Value: "androidx.wear.activity.extra.MESSAGE"

FAILURE_ANIMATION

static val FAILURE_ANIMATION: Int
Value: 3

OPEN_ON_PHONE_ANIMATION

static val OPEN_ON_PHONE_ANIMATION: Int
Value: 2

SUCCESS_ANIMATION

static val SUCCESS_ANIMATION: Int
Value: 1

Public constructors

<init>

ConfirmationActivity()

This Activity is used to display confirmation animations after the user completes an action on the wearable. There are three types of confirmations: Success: the action was completed successfully on the wearable. Failure: the action failed to complete. Open on Phone: the action has caused something to display on the phone, or in order to complete the action, the user will need to go to their phone to continue.

It is the responsibility of the wearable application developer to determine whether the action has succeeded, failed, or requires the user to go to their phone, and trigger the appropriate confirmation.

To configure the confirmation according to the result of the action, set the extra to one of the following values:

SUCCESS_ANIMATION
Displays a positive confirmation animation with an optional message.
OPEN_ON_PHONE_ANIMATION
Displays an animation indicating an action has been sent to a paired device.
FAILURE_ANIMATION
Displays a generic failure page with an optional message.
An optional message, included in the extra EXTRA_MESSAGE will be displayed horizontally centered below the animation.

Public methods

onCreate

open fun onCreate(savedInstanceState: Bundle!): Unit

Protected methods

onAnimationFinished

protected open fun onAnimationFinished(): Unit

Override this method if you wish to provide different than out-of-the-box behavior when the confirmation animation finishes. By default this method will finish the ConfirmationActivity.