WatchFaceCompanion

public final class WatchFaceCompanion
extends Object

java.lang.Object
   ↳ android.support.wearable.companion.WatchFaceCompanion


表面配置活动使用的常量。

要注册表盘的配置活动,请将<meta-data>条目添加到其Android Manifest文件中的表盘组件,并使用意向操作来启动该活动。 以下元数据将注册在可穿戴设备上配置表盘时启动的com.example.watchface.CONFIG_DIGITAL动作:

 <meta-data
     android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
     android:value="com.example.watchface.CONFIG_DIGITAL" />

要注册要在伴侣电话上启动的配置活动,请将以下备选元数据条目添加到监视面部件:

 <meta-data
     android:name="com.google.android.wearable.watchface.companionConfigurationAction"
     android:value="com.example.watchface.CONFIG_DIGITAL" />

除了以下示例中的两个类别之外,活动应该有一个意图过滤器,其中列出了上述元数据块中指定的操作:

 <activity android:name=".MyWatchFaceConfigActivity">
     <intent-filter>
         <action android:name="com.example.watchface.CONFIG_DIGITAL" />
         <category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
         <category android:name="android.intent.category.DEFAULT" />
     </intent-filter>
 </activity>

对于电话端配置活动,请将类别 com.google.android.wearable.watchface.category.COMPANION_CONFIGURATIONcom.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION

Summary

Constants

String EXTRA_PEER_ID

String额外指定电话端配置活动启动 Intent当前连接设备的ID的 Intent

String EXTRA_WATCH_FACE_COMPONENT

对于重点 String额外指定 ComponentName表盘在配置活动推出配置 Intent

Inherited methods

From class java.lang.Object

Constants

EXTRA_PEER_ID

String EXTRA_PEER_ID

String额外指定电话端配置活动启动 Intent当前连接设备的ID的 Intent

常量值:“android.support.wearable.watchface.extra.PEER_ID”

EXTRA_WATCH_FACE_COMPONENT

String EXTRA_WATCH_FACE_COMPONENT

对于重点 String额外指定 ComponentName表盘在配置活动推出配置 Intent

常量值:“android.support.wearable.watchface.extra.WATCH_FACE_COMPONENT”