ConfirmationActivity

Added in 1.1.0

class ConfirmationActivity : Activity


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 EXTRA_ANIMATION_TYPE 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.

An optional duration in milliseconds to keep the confirmation activity visible for, included in the extra EXTRA_ANIMATION_DURATION_MILLIS

Summary

Constants

const String!
EXTRA_ANIMATION_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS"

The lookup key for an optional int that defines the duration in milliseconds that the confirmation activity should be displayed.

const String!
EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE"

The lookup key for an optional int that defines the animation type that should be displayed.

const String!
EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE"

Used as a string extra field on an intent for this activity to define the message that should be displayed to the user while the activity is visible.

const Int
const Int
const Int

Public constructors

Public functions

Unit
onCreate(savedInstanceState: Bundle!)

Protected functions

Unit

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

Inherited Constants

From android.app.Activity
From android.content.ComponentCallbacks2
From android.content.Context
const String!
ACCESSIBILITY_SERVICE = "accessibility"
const String!
ACCOUNT_SERVICE = "account"
const String!
ACTIVITY_SERVICE = "activity"
const String!
ALARM_SERVICE = "alarm"
const String!
APPWIDGET_SERVICE = "appwidget"
const String!
APP_OPS_SERVICE = "appops"
const String!
APP_SEARCH_SERVICE = "app_search"
const String!
AUDIO_SERVICE = "audio"
const String!
BATTERY_SERVICE = "batterymanager"
const Int
const Int
const Int
const Int
const Int
const Int
const Int
BIND_EXTERNAL_SERVICE = -2147483648
const Long
BIND_EXTERNAL_SERVICE_LONG = 4611686018427387904
const Int
const Int
const Int
const Int
const Int
const Int
const String!
BIOMETRIC_SERVICE = "biometric"
const String!
BLOB_STORE_SERVICE = "blob_store"
const String!
BLUETOOTH_SERVICE = "bluetooth"
const String!
BUGREPORT_SERVICE = "bugreport"
const String!
CAMERA_SERVICE = "camera"
const String!
CAPTIONING_SERVICE = "captioning"
const String!
CARRIER_CONFIG_SERVICE = "carrier_config"
const String!
CLIPBOARD_SERVICE = "clipboard"
const String!
COMPANION_DEVICE_SERVICE = "companiondevice"
const String!
CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"
const String!
CONNECTIVITY_SERVICE = "connectivity"
const String!
CONSUMER_IR_SERVICE = "consumer_ir"
const Int
const Int
const Int
const String!
CREDENTIAL_SERVICE = "credential"
const String!
CROSS_PROFILE_APPS_SERVICE = "crossprofileapps"
const Int
const Int
const String!
DEVICE_LOCK_SERVICE = "device_lock"
const String!
DEVICE_POLICY_SERVICE = "device_policy"
const String!
DISPLAY_HASH_SERVICE = "display_hash"
const String!
DISPLAY_SERVICE = "display"
const String!
DOMAIN_VERIFICATION_SERVICE = "domain_verification"
const String!
DOWNLOAD_SERVICE = "download"
const String!
DROPBOX_SERVICE = "dropbox"
const String!
EUICC_SERVICE = "euicc"
const String!
FILE_INTEGRITY_SERVICE = "file_integrity"
const String!
FINGERPRINT_SERVICE = "fingerprint"
const String!
GAME_SERVICE = "game"
const String!
GRAMMATICAL_INFLECTION_SERVICE = "grammatical_inflection"
const String!
HARDWARE_PROPERTIES_SERVICE = "hardware_properties"
const String!
HEALTHCONNECT_SERVICE = "healthconnect"
const String!
INPUT_METHOD_SERVICE = "input_method"
const String!
INPUT_SERVICE = "input"
const String!
IPSEC_SERVICE = "ipsec"
const String!
JOB_SCHEDULER_SERVICE = "jobscheduler"
const String!
KEYGUARD_SERVICE = "keyguard"
const String!
LAUNCHER_APPS_SERVICE = "launcherapps"
const String!
LAYOUT_INFLATER_SERVICE = "layout_inflater"
const String!
LOCALE_SERVICE = "locale"
const String!
LOCATION_SERVICE = "location"
const String!
MEDIA_COMMUNICATION_SERVICE = "media_communication"
const String!
MEDIA_METRICS_SERVICE = "media_metrics"
const String!
MEDIA_PROJECTION_SERVICE = "media_projection"
const String!
MEDIA_ROUTER_SERVICE = "media_router"
const String!
MEDIA_SESSION_SERVICE = "media_session"
const String!
MIDI_SERVICE = "midi"
const Int
MODE_APPEND = 32768
const Int
const Int

This property is deprecated.

const Int
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const String!
const String!
NFC_SERVICE = "nfc"
const String!
NOTIFICATION_SERVICE = "notification"
const String!
NSD_SERVICE = "servicediscovery"
const String!
OVERLAY_SERVICE = "overlay"
const String!
PEOPLE_SERVICE = "people"
const String!
PERFORMANCE_HINT_SERVICE = "performance_hint"
const String!
POWER_SERVICE = "power"
const String!
PRINT_SERVICE = "print"
const Int
const Int
const Int
const String!
RESTRICTIONS_SERVICE = "restrictions"
const String!
ROLE_SERVICE = "role"
const String!
SEARCH_SERVICE = "search"
const String!
SENSOR_SERVICE = "sensor"
const String!
SHORTCUT_SERVICE = "shortcut"
const String!
STATUS_BAR_SERVICE = "statusbar"
const String!
STORAGE_SERVICE = "storage"
const String!
STORAGE_STATS_SERVICE = "storagestats"
const String!
SYSTEM_HEALTH_SERVICE = "systemhealth"
const String!
TELECOM_SERVICE = "telecom"
const String!
TELEPHONY_IMS_SERVICE = "telephony_ims"
const String!
const String!
TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service"
const String!
TEXT_CLASSIFICATION_SERVICE = "textclassification"
const String!
const String!
TV_INPUT_SERVICE = "tv_input"
const String!
TV_INTERACTIVE_APP_SERVICE = "tv_interactive_app"
const String!
UI_MODE_SERVICE = "uimode"
const String!
USAGE_STATS_SERVICE = "usagestats"
const String!
USB_SERVICE = "usb"
const String!
USER_SERVICE = "user"
const String!
VIBRATOR_MANAGER_SERVICE = "vibrator_manager"
const String!
VIBRATOR_SERVICE = "vibrator"

This property is deprecated.

const String!
VIRTUAL_DEVICE_SERVICE = "virtualdevice"
const String!
VPN_MANAGEMENT_SERVICE = "vpn_management"
const String!
WALLPAPER_SERVICE = "wallpaper"
const String!
WIFI_AWARE_SERVICE = "wifiaware"
const String!
WIFI_P2P_SERVICE = "wifip2p"
const String!
const String!
WIFI_SERVICE = "wifi"
const String!
WINDOW_SERVICE = "window"

Inherited functions

From android.app.Activity
Unit
Unit
Unit
Unit
Unit
PendingIntent!
createPendingResult(requestCode: Int, data: Intent!, flags: Int)
Unit

This function is deprecated.

Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
dump(
    prefix: String!,
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
)
Unit

This function is deprecated.

Boolean
T!
<T : View?> findViewById(id: Int)
Unit
Unit
finishActivity(requestCode: Int)
Unit
finishActivityFromChild(child: Activity!, requestCode: Int)

This function is deprecated.

Unit
Unit
Unit
Unit

This function is deprecated.

ActionBar!
Application!
ComponentName!
String!
Int
ComponentName!
Scene!
TransitionManager!
View!
FragmentManager!

This function is deprecated.

Intent!
Any!
String!
Int
LayoutInflater!
LoaderManager!

This function is deprecated.

String!
Int
MediaController!
MenuInflater!
OnBackInvokedDispatcher!
Activity!
Intent!
SharedPreferences!
Uri!
Int
SearchEvent!
SplashScreen!
Any!
Int
CharSequence!
Int
VoiceInteractor!
Int
Window!
WindowManager!
Boolean
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Cursor!
managedQuery(
    uri: Uri!,
    projection: Array<String!>!,
    selection: String!,
    selectionArgs: Array<String!>!,
    sortOrder: String!
)

This function is deprecated.

Boolean
Boolean
navigateUpTo(upIntent: Intent!)
Boolean
navigateUpToFromChild(child: Activity!, upIntent: Intent!)

This function is deprecated.

Unit
Unit
Unit
onActivityReenter(resultCode: Int, data: Intent!)
Unit
onActivityResult(requestCode: Int, resultCode: Int, data: Intent!)
Unit
onApplyThemeResource(theme: Resources.Theme!, resid: Int, first: Boolean)
Unit

This function is deprecated.

Unit
Unit

This function is deprecated.

Unit
onChildTitleChanged(childActivity: Activity!, title: CharSequence!)
Unit
Unit
Boolean
Unit
Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)
CharSequence!
Dialog!

This function is deprecated.

Unit
Boolean
Boolean
onCreatePanelMenu(featureId: Int, menu: Menu!)
View!
onCreatePanelView(featureId: Int)
Boolean
onCreateThumbnail(outBitmap: Bitmap!, canvas: Canvas!)

This function is deprecated.

View!
onCreateView(name: String!, context: Context!, attrs: AttributeSet!)
Unit
Unit
Unit
Boolean
Unit
onGetDirectActions(
    cancellationSignal: CancellationSignal!,
    callback: Consumer<(Mutable)List<DirectAction!>!>!
)
Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent!)
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent!)
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent!)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)
Unit
Unit
Unit
Boolean
onMenuItemSelected(featureId: Int, item: MenuItem!)
Boolean
onMenuOpened(featureId: Int, menu: Menu!)
Unit
onMultiWindowModeChanged(
    isInMultiWindowMode: Boolean,
    newConfig: Configuration!
)
Boolean
Boolean

This function is deprecated.

Unit
onNewIntent(intent: Intent!)
Boolean
Unit
Unit
onPanelClosed(featureId: Int, menu: Menu!)
Unit
Unit
onPerformDirectAction(
    actionId: String!,
    arguments: Bundle!,
    cancellationSignal: CancellationSignal!,
    resultListener: Consumer<Bundle!>!
)
Unit
onPictureInPictureModeChanged(
    isInPictureInPictureMode: Boolean,
    newConfig: Configuration!
)
Boolean
Unit
Unit
onPostCreate(savedInstanceState: Bundle!)
Unit
Unit
onPrepareDialog(id: Int, dialog: Dialog!)

This function is deprecated.

Unit
Boolean
Boolean
onPreparePanel(featureId: Int, view: View!, menu: Menu!)
Unit
Unit
Unit
onProvideKeyboardShortcuts(
    data: (Mutable)List<KeyboardShortcutGroup!>!,
    menu: Menu!,
    deviceId: Int
)
Uri!
Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String!>!,
    grantResults: IntArray!
)
Unit
Unit
onRestoreInstanceState(savedInstanceState: Bundle!)
Unit
Any!
Unit
Boolean
Unit
Unit

This function is deprecated.

Unit
Unit
onTitleChanged(title: CharSequence!, color: Int)
Unit
onTopResumedActivityChanged(isTopResumedActivity: Boolean)
Boolean
Boolean
Unit
onTrimMemory(level: Int)
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
ActionMode!
Unit
Unit
Unit
overrideActivityTransition(
    overrideType: Int,
    enterAnim: Int,
    exitAnim: Int
)
Unit
overridePendingTransition(enterAnim: Int, exitAnim: Int)

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Unit
Boolean
Unit

This function is deprecated.

Unit
DragAndDropPermissions!
Unit
requestFullscreenMode(
    request: Int,
    approvalCallback: OutcomeReceiver<Void!, Throwable!>!
)
Unit
requestPermissions(permissions: Array<String!>!, requestCode: Int)
Unit
Boolean

This function is deprecated.

Boolean
T!
<T : View?> requireViewById(id: Int)
Unit
Unit
setActionBar(toolbar: Toolbar!)
Unit
Unit
setContentView(layoutResID: Int)
Unit
Unit
Unit
Unit
setFeatureDrawable(featureId: Int, drawable: Drawable!)
Unit
setFeatureDrawableAlpha(featureId: Int, alpha: Int)
Unit
setFeatureDrawableResource(featureId: Int, resId: Int)
Unit
setFeatureDrawableUri(featureId: Int, uri: Uri!)
Unit
Unit
Unit
setInheritShowWhenLocked(inheritShowWhenLocked: Boolean)
Unit
setIntent(newIntent: Intent!)
Unit
setLocusContext(locusId: LocusId!, bundle: Bundle!)
Unit
Unit
Unit
setProgress(progress: Int)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit
setRequestedOrientation(requestedOrientation: Int)
Unit
setResult(resultCode: Int)
Unit
setSecondaryProgress(secondaryProgress: Int)

This function is deprecated.

Unit
setShouldDockBigOverlays(shouldDockBigOverlays: Boolean)
Unit
setShowWhenLocked(showWhenLocked: Boolean)
Unit
Unit
setTheme(resid: Int)
Unit
Unit
setTitleColor(textColor: Int)

This function is deprecated.

Boolean
setTranslucent(translucent: Boolean)
Unit
setTurnScreenOn(turnScreenOn: Boolean)
Unit
setVisible(visible: Boolean)
Unit
Unit
setVrModeEnabled(enabled: Boolean, requestedComponent: ComponentName!)
Boolean
Boolean
Boolean
shouldUpRecreateTask(targetIntent: Intent!)
Boolean
Unit

This function is deprecated.

Boolean
showDialog(id: Int, args: Bundle!)

This function is deprecated.

Unit
ActionMode!
Unit
Unit
Unit
startActivityForResult(intent: Intent!, requestCode: Int)
Unit
startActivityFromChild(child: Activity!, intent: Intent!, requestCode: Int)

This function is deprecated.

Unit
startActivityFromFragment(
    fragment: Fragment!,
    intent: Intent!,
    requestCode: Int
)

This function is deprecated.

Boolean
startActivityIfNeeded(intent: Intent!, requestCode: Int)
Unit
startIntentSender(
    intent: IntentSender!,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)
Unit
startIntentSenderForResult(
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)
Unit
startIntentSenderFromChild(
    child: Activity!,
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)

This function is deprecated.

Unit
Unit
Unit

This function is deprecated.

Boolean
Unit
Unit
startSearch(
    initialQuery: String!,
    selectInitialQuery: Boolean,
    appSearchData: Bundle!,
    globalSearch: Boolean
)
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
triggerSearch(query: String!, appSearchData: Bundle!)
Unit
Unit
Unit
Unit
From android.content.Context
From android.view.ContextThemeWrapper
From android.content.ContextWrapper
Boolean
bindIsolatedService(
    service: Intent!,
    flags: Int,
    instanceName: String!,
    executor: Executor!,
    conn: ServiceConnection!
)
Boolean
bindService(service: Intent!, conn: ServiceConnection!, flags: Int)
Boolean
bindServiceAsUser(
    service: Intent!,
    conn: ServiceConnection!,
    flags: Int,
    user: UserHandle!
)
Int
Int
IntArray<Int>!
checkCallingOrSelfUriPermissions(
    uris: (Mutable)List<Uri!>!,
    modeFlags: Int
)
Int
Int
checkCallingUriPermission(uri: Uri!, modeFlags: Int)
IntArray<Int>!
checkCallingUriPermissions(uris: (Mutable)List<Uri!>!, modeFlags: Int)
Int
checkPermission(permission: String!, pid: Int, uid: Int)
Int
Int
checkUriPermission(uri: Uri!, pid: Int, uid: Int, modeFlags: Int)
IntArray<Int>!
checkUriPermissions(
    uris: (Mutable)List<Uri!>!,
    pid: Int,
    uid: Int,
    modeFlags: Int
)
Unit

This function is deprecated.

Context!
createAttributionContext(attributionTag: String!)
Context!
createConfigurationContext(overrideConfiguration: Configuration!)
Context!
createContext(contextParams: ContextParams!)
Context!
Context!
Context!
Context!
Context!
createPackageContext(packageName: String!, flags: Int)
Context!
createWindowContext(type: Int, options: Bundle!)
Array<String!>!
Boolean
Boolean
Boolean
Unit
enforceCallingOrSelfPermission(permission: String!, message: String!)
Unit
enforceCallingOrSelfUriPermission(
    uri: Uri!,
    modeFlags: Int,
    message: String!
)
Unit
enforceCallingPermission(permission: String!, message: String!)
Unit
enforceCallingUriPermission(uri: Uri!, modeFlags: Int, message: String!)
Unit
enforcePermission(permission: String!, pid: Int, uid: Int, message: String!)
Unit
enforceUriPermission(
    uri: Uri!,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String!
)
Array<String!>!
Context!
ApplicationInfo!
AttributionSource!
String!
Context!
File!
ClassLoader!
File!
ContentResolver!
File!
File!
Int
File!
getDir(name: String!, mode: Int)
Display!
File!
Array<File!>!
File!
Array<File!>!
Array<File!>!

This function is deprecated.

File!
File!
Executor!
Looper!
File!
File!
Array<File!>!
String!
String!
PackageManager!
String!
String!
ContextParams!
SharedPreferences!
getSharedPreferences(name: String!, mode: Int)
String!
getSystemServiceName(serviceClass: Class<Any!>!)
Drawable!

This function is deprecated.

Int

This function is deprecated.

Int

This function is deprecated.

Unit
grantUriPermission(toPackage: String!, uri: Uri!, modeFlags: Int)
Boolean
Boolean
Boolean
Boolean
moveDatabaseFrom(sourceContext: Context!, name: String!)
Boolean
moveSharedPreferencesFrom(sourceContext: Context!, name: String!)
FileInputStream!
FileOutputStream!
openFileOutput(name: String!, mode: Int)
SQLiteDatabase!
openOrCreateDatabase(
    name: String!,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory!
)
Drawable!

This function is deprecated.

Unit
Intent!
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit
revokeUriPermission(uri: Uri!, modeFlags: Int)
Unit
Unit
Unit
sendOrderedBroadcast(intent: Intent!, receiverPermission: String!)
Unit
sendOrderedBroadcastAsUser(
    intent: Intent!,
    user: UserHandle!,
    receiverPermission: String!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
sendStickyOrderedBroadcast(
    intent: Intent!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)

This function is deprecated.

Unit
sendStickyOrderedBroadcastAsUser(
    intent: Intent!,
    user: UserHandle!,
    resultReceiver: BroadcastReceiver!,
    scheduler: Handler!,
    initialCode: Int,
    initialData: String!,
    initialExtras: Bundle!
)

This function is deprecated.

Unit
setWallpaper(bitmap: Bitmap!)

This function is deprecated.

ComponentName!
Boolean
startInstrumentation(
    className: ComponentName!,
    profileFile: String!,
    arguments: Bundle!
)
ComponentName!
startService(service: Intent!)
Boolean
Unit
Unit
Unit
Unit
updateServiceGroup(conn: ServiceConnection!, group: Int, importance: Int)
From android.view.Window.Callback

Constants

EXTRA_ANIMATION_DURATION_MILLIS

Added in 1.1.0
const val EXTRA_ANIMATION_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS": String!

The lookup key for an optional int that defines the duration in milliseconds that the confirmation activity should be displayed. If no value is specified it will default to DEFAULT_ANIMATION_DURATION_MS

EXTRA_ANIMATION_TYPE

Added in 1.1.0
const val EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE": String!

The lookup key for an optional int that defines the animation type that should be displayed. Should be one of SUCCESS_ANIMATION, OPEN_ON_PHONE_ANIMATION, or FAILURE_ANIMATION

If no value is specified it will default to SUCCESS_ANIMATION

EXTRA_MESSAGE

Added in 1.1.0
const val EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE": String!

Used as a string extra field on an intent for this activity to define the message that should be displayed to the user while the activity is visible.

FAILURE_ANIMATION

Added in 1.1.0
const val FAILURE_ANIMATION = 3: Int

OPEN_ON_PHONE_ANIMATION

Added in 1.1.0
const val OPEN_ON_PHONE_ANIMATION = 2: Int

SUCCESS_ANIMATION

Added in 1.1.0
const val SUCCESS_ANIMATION = 1: Int

Public constructors

ConfirmationActivity

Added in 1.1.0
ConfirmationActivity()

Public functions

onCreate

Added in 1.1.0
fun onCreate(savedInstanceState: Bundle!): Unit

Protected functions

onAnimationFinished

Added in 1.1.0
protected 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.