ConfirmationActivity

public class ConfirmationActivity
extends Activity

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ android.support.wearable.activity.ConfirmationActivity


此活动用于在用户完成可穿戴设备上的操作后显示确认动画。 有三种类型的确认:成功:行动在可穿戴设备上成功完成。 失败:操作未能完成。 在电话上打开:该操作导致在手机上显示某些内容,或者为了完成操作,用户需要转到其电话才能继续。

可穿戴应用程序开发人员有责任确定操作是成功,失败还是要求用户使用手机,并触发相应的确认。

要根据操作结果配置确认,请将额外的 EXTRA_ANIMATION_TYPE设置为以下值之一:

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

String EXTRA_ANIMATION_TYPE

String EXTRA_MESSAGE

int FAILURE_ANIMATION

int OPEN_ON_PHONE_ANIMATION

int SUCCESS_ANIMATION

Inherited constants

From class android.app.Activity
From class android.content.Context
From interface android.content.ComponentCallbacks2

Inherited fields

From class android.app.Activity

Public constructors

ConfirmationActivity()

Public methods

void onCreate(Bundle savedInstanceState)

Inherited methods

From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.view.LayoutInflater.Factory2
From interface android.view.Window.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks2
From interface android.view.Window.OnWindowDismissedCallback
From interface android.view.Window.WindowControllerCallback
From interface android.view.LayoutInflater.Factory
From interface android.content.ComponentCallbacks

Constants

EXTRA_ANIMATION_TYPE

String EXTRA_ANIMATION_TYPE

常量值:“animation_type”

EXTRA_MESSAGE

String EXTRA_MESSAGE

常量值:“消息”

FAILURE_ANIMATION

int FAILURE_ANIMATION

常量值:3(0x00000003)

OPEN_ON_PHONE_ANIMATION

int OPEN_ON_PHONE_ANIMATION

常量值:2(0x00000002)

SUCCESS_ANIMATION

int SUCCESS_ANIMATION

常数值:1(0x00000001)

Public constructors

ConfirmationActivity

ConfirmationActivity ()

Public methods

onCreate

void onCreate (Bundle savedInstanceState)

Parameters
savedInstanceState Bundle