android手表选择菜单选项?

android watch selection menu options?

如何将选择选项添加到手表选择菜单中。

一些手表(例如 InstaWeather)在选择缩略图下显示一个齿轮,点击齿轮提供设置。

很遗憾,我找不到 InstaWeather 手表的源代码。

但一定是可以的。

根据 Providing Configuration Activities training:

Watch faces that support configuration parameters can let users customize a watch face using an activity in the wearable app, an activity on the handheld app, or both. Users can start the wearable configuration activity on the wearable device, and they can start the companion configuration activity from the Android Wear companion app.

示例代码包括如何添加可穿戴配置activity:

<service
  android:name=".DigitalWatchFaceService" ... />
  <!-- companion configuration activity -->
  <meta-data
    android:name=
       "com.google.android.wearable.watchface.companionConfigurationAction"
    android:value=
       "com.example.android.wearable.watchface.CONFIG_DIGITAL" />
  <!-- wearable configuration activity -->
  <meta-data
    android:name=
       "com.google.android.wearable.watchface.wearableConfigurationAction"
    android:value=
       "com.example.android.wearable.watchface.CONFIG_DIGITAL" />
  ...
</service>