4

I've updated my Android Wear watch face according to the official API, and overall it's gone pretty well. One thing I'm stuck on, however, is launching the companion (handheld) config activity from within the Android Wear app. I just can't get the "gear" icon to appear on my watch face preview image in the AW app - AW isn't recognizing my config link.

Just to be clear, every other part of this app is working OK; the app runs fine on both devices, the watch face works, Data API works, auto-install works. It's just this link to my settings activity that's borked.

Here's the relevant portion of my handheld app's manifest:

 <activity
    android:name=".google.WatchfaceSettingsActivity"
    android:label="@string/pref_wear_wf_title" >
    <intent-filter>
        <action android:name="com.mypackage.google.CONFIG_WEAR_WATCHFACE" />
        <category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

And here's the matching bit of my wearable app's manifest:

<service
    android:name=".wear.WatchFaceService"
    android:label="@string/app_name"
    android:permission="android.permission.BIND_WALLPAPER" >
    <meta-data
        android:name="android.service.wallpaper"
        android:resource="@xml/watch_face" />
    <meta-data
        android:name="com.google.android.wearable.watchface.companionConfigurationAction"
        android:value="com.mypackage.google.CONFIG_WEAR_WATCHFACE" />
    <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService" />
        <category
            android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
    </intent-filter>
</service>

As I understand it, the crucial part is the com.mypackage.google.CONFIG_WEAR_WATCHFACE string, which appears in both manifests. Everything looks OK to me - is there just something stupid I'm missing?

Sterling
  • 6,365
  • 2
  • 32
  • 40

1 Answers1

3

Almost correct, but it looks like the intent filter category for your handheld Activity is set incorrectly as WEARABLE_CONFIGURATION. It should be:

com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION

More info: http://developer.android.com/training/wearables/watch-faces/configuration.html

myanimal
  • 3,580
  • 26
  • 26
  • 1
    That was it - I'd copied the wrong filter. Duh! I just needed another pair of eyes to look at my code. Many thanks! – Sterling Feb 02 '15 at 21:16