简体   繁体   English

我的LG G Watch R没有提供Android表盘预览

[英]Android watch face preview is not available on my LG G Watch R

I'm using Android Studio 1.0.2 and I've created a new watch face project by following instructions on Android developer site: https://developer.android.com/training/wearables/watch-faces/service.html I ended up with an application that can be run on my watch, showing the Hello round world text, but the watch face is not available/visible in the watch face picker. 我正在使用Android Studio 1.0.2,并且按照Android开发者网站上的说明创建了一个新的表盘项目: https : //developer.android.com/training/wearables/watch-faces/service.html我结束了与可以在我的手表上运行的应用程序配合使用,该应用程序显示“ Hello round world文字,但表盘选择器中的表盘不可用/不可见。 Just as if there is no service registration in manifest file. 就像清单文件中没有服务注册一样。 I have no idea what may be wrong - I double checked all steps and necessary settings in manifest file. 我不知道有什么问题-我仔细检查了清单文件中的所有步骤和必要的设置。 Does anyone have any idea what to check? 有谁知道要检查什么? Have anyone experienced the same problem? 有没有人遇到过同样的问题? Thank you! 谢谢!

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.dmn.meteorwatch" >

<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature android:name="android.hardware.type.watch" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.DeviceDefault" >
    <activity
        android:name=".WatchfaceActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

<service
    android:name=".MeteorWatchFaceService"
    android:label="Meteor"
    android:allowEmbedded="true"
    android:taskAffinity=""
    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.preview"
        android:resource="@drawable/preview" />
    <!--<meta-data
        android:name="com.google.android.wearable.watchface.preview_circular"
        android:resource="@drawable/preview" />-->
    <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService" />
        <category
            android:name=
                "com.google.android.wearable.watchface.category.WATCH_FACE" />
    </intent-filter>
</service>

Comparing with sample application manifest I've found out, that I misplaced the <service> tag within the manifest file. 与我发现的示例应用程序清单相比,我在清单文件中放错了<service>标记。 Having put it within an <application> tag solved the problem. 将其放在<application>标记中可以解决此问题。 Sorry for bothering with such dumb mistake. 很抱歉打扰这种愚蠢的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM