Android Wear应用没有出现在"启动..."值班菜单 [英] Android Wear App not showing up in "Start..." menu on watch

查看:246
本文介绍了Android Wear应用没有出现在"启动..."值班菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个穿模块到我的Andr​​oid Studio中的Andr​​oid应用。在移动模块,我已经在移动应用程序指定该行的build.gradle:

I have added a wear module to my Android Application in Android Studio. In the mobile module, I have specified this line in the mobile applications build.gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:+'
    compile "com.android.support:support-v4:20.0.+"
    wearApp project(':wear')
}

此外,这里是我的Andr​​oidManifest.xml的穿模块。

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

    <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=".MainActivity"
            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>

</manifest>

在logcat中,我看到的应用程序安装在手表中的消息。

In logcat, I see the messages that the application is installed on the watch.

09-16 17:12:03.075: D/WearablePkgInstaller(1023): Got PackageUpdateReceiver message Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.myapplication flg=0x4000010 cmp=com.google.android.wearable.app/com.google.android.clockwork.companion.packagemanager.PackageUpdateReceiver (has extras) }

不过,我不能去开始... 查找应用程序!有什么明显的我失踪?

However, I can't go to Start... to find the application! Is there something obvious I'm missing?

推荐答案

我是缺少来自该行的耐磨的Andr​​oidManifest.xml

I was missing this line from the wearable AndroidManifest.xml

更具体地说,这需要在XML结构的应用程序部分。

More specifically, this needs to be in the application section of the xml structure.

<application
    android:icon="@drawable/ic_launcher"
    ... >

    <meta-data android:name="com.google.android.clockwork.home.preview" 
        android:resource="@drawable/ic_launcher" />

这篇关于Android Wear应用没有出现在&QUOT;启动...&QUOT;值班菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆