Stay organized with collections
Save and categorize content based on your preferences.
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
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
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"
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"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# WatchFaceCompanion\n\nSummary: [Constants](#constants) \\| [Inherited Methods](#inhmethods) \n\nWatchFaceCompanion\n==================\n\n\n`\npublic\n\nfinal\n\nclass\nWatchFaceCompanion\n`\n\n\n`\n\nextends `[Object](http://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------------------------------|\n| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | android.support.wearable.companion.WatchFaceCompanion |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class is deprecated.** \n\nUse methods provided by `androidx.wear.remote.interactions.WatchFaceConfigIntentHelper` in the [Jetpack Wear Remote Interactions](../../../../../jetpack/androidx/releases/wear) library\ninstead\n\nConstants for use by watch face configuration activities.\n\nTo register a configuration activity for a watch face, add a `\u003cmeta-data\u003e` entry to the\nwatch face component in its Android Manifest file with an intent action to be fired to start the\nactivity. The following meta-data will register the `com.example.watchface.CONFIG_DIGITAL`\naction to be started when configuring a watch face on the wearable device:\n\n```scdoc\n \u003cmeta-data\n android:name=\"com.google.android.wearable.watchface.wearableConfigurationAction\"\n android:value=\"com.example.watchface.CONFIG_DIGITAL\" /\u003e\n```\n\nTo register a configuration activity to be started on a companion phone, add the following\nalternative meta-data entry to the watch face component:\n\n```scdoc\n \u003cmeta-data\n android:name=\"com.google.android.wearable.watchface.companionConfigurationAction\"\n android:value=\"com.example.watchface.CONFIG_DIGITAL\" /\u003e\n```\n\nThe activity should have an intent filter which lists the action specified in the meta-data\nblock above, in addition to the two categories present in the following example:\n\n```scdoc\n \u003cactivity android:name=\".MyWatchFaceConfigActivity\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"com.example.watchface.CONFIG_DIGITAL\" /\u003e\n \u003ccategory android:name=\"com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/activity\u003e\n```\n\nFor phone side configuration activities, substitute the category `com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION` for `com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION`.\n\nSummary\n-------\n\n| ### Constants ||\n|------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](http://developer.android.com/reference/java/lang/String.html) | [EXTRA_PEER_ID](../../../../../reference/android/support/wearable/companion/WatchFaceCompanion.html#EXTRA_PEER_ID) The key for [String](http://developer.android.com/reference/java/lang/String.html) extra specifying the ID of the currently connected device in the phone-side config activity launch [Intent](http://developer.android.com/reference/android/content/Intent.html). |\n| [String](http://developer.android.com/reference/java/lang/String.html) | [EXTRA_WATCH_FACE_COMPONENT](../../../../../reference/android/support/wearable/companion/WatchFaceCompanion.html#EXTRA_WATCH_FACE_COMPONENT) The key for [String](http://developer.android.com/reference/java/lang/String.html) extra specifying a [ComponentName](http://developer.android.com/reference/android/content/ComponentName.html) of the watch face being configured in the config activity launch [Intent](http://developer.android.com/reference/android/content/Intent.html). |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html) | ` clone() ` | | ` boolean` | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void` | ` finalize() ` | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](http://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nConstants\n---------\n\n### EXTRA_PEER_ID\n\n```\npublic static final String EXTRA_PEER_ID\n```\n\nThe key for [String](http://developer.android.com/reference/java/lang/String.html) extra specifying the ID of the currently connected device in the\nphone-side config activity launch [Intent](http://developer.android.com/reference/android/content/Intent.html).\n\n\u003cbr /\u003e\n\nConstant Value:\n\n\"android.support.wearable.watchface.extra.PEER_ID\"\n\n\n### EXTRA_WATCH_FACE_COMPONENT\n\n```\npublic static final String EXTRA_WATCH_FACE_COMPONENT\n```\n\nThe key for [String](http://developer.android.com/reference/java/lang/String.html) extra specifying a [ComponentName](http://developer.android.com/reference/android/content/ComponentName.html) of the\nwatch face being configured in the config activity launch [Intent](http://developer.android.com/reference/android/content/Intent.html).\n\n\u003cbr /\u003e\n\nConstant Value:\n\n\"android.support.wearable.watchface.extra.WATCH_FACE_COMPONENT\""]]