WatchFaceCompanion
public
final
class
WatchFaceCompanion
extends Object
This class is deprecated.
Use methods provided by androidx.wear.remote.interactions.WatchFaceConfigIntentHelper in the Jetpack Wear Remote Interactions library
instead
Constants for use by watch face configuration activities.
To register a configuration activity for a watch face, add a <meta-data> entry to the
watch face component in its Android Manifest file with an intent action to be fired to start the
activity. The following meta-data will register the com.example.watchface.CONFIG_DIGITAL
action to be started when configuring a watch face on the wearable device:
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="com.example.watchface.CONFIG_DIGITAL" />
To register a configuration activity to be started on a companion phone, add the following
alternative meta-data entry to the watch face component:
<meta-data
android:name="com.google.android.wearable.watchface.companionConfigurationAction"
android:value="com.example.watchface.CONFIG_DIGITAL" />
The activity should have an intent filter which lists the action specified in the meta-data
block above, in addition to the two categories present in the following example:
<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>
For phone side configuration activities, substitute the category com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION for com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION.
Summary
Constants | |
|---|---|
String |
EXTRA_PEER_ID
The key for |
String |
EXTRA_WATCH_FACE_COMPONENT
The key for |
Inherited methods | |
|---|---|
|
From class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class<?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
| |
Constants
EXTRA_PEER_ID
public static final String EXTRA_PEER_ID
The key for String extra specifying the ID of the currently connected device in the
phone-side config activity launch Intent .
Constant Value: "android.support.wearable.watchface.extra.PEER_ID"
EXTRA_WATCH_FACE_COMPONENT
public static final String EXTRA_WATCH_FACE_COMPONENT
The key for String extra specifying a ComponentName of the
watch face being configured in the config activity launch Intent .
Constant Value: "android.support.wearable.watchface.extra.WATCH_FACE_COMPONENT"