开发阶段的Android Wear应用程序未出现在手表启动器

时间:2015-12-10 07:21:59

标签: android android-studio wear-os

当我通过Android工作室运行我开发的android Wear应用程序时,它通常安装在我的手表中,以后可以通过磨损启动器启动。不知道会发生什么,我的最新项目不再在启动器中显示为图标,尽管我可以看到应用程序正在启动并且功能齐全,但在环境模式之后,当应用程序移动到后台时,我无法重新启动磨损。唯一的方法是再次从Android Studio启动它。应用程序图标已从手表中删除,我无法弄清楚原因! 当我通过ADB查看手机中的软件包列表时,我可以看到它已列出,但它从未出现在已安装的应用程序中,并且它在几天前就已经出现了。 我有LG G Watch R与Android 5.1.1,Android Wear 1.3.0.2166028和Android Studio 1.5.0 / 141.2422023

1 个答案:

答案 0 :(得分:0)

This is what I figured out by trying different manifest setups:

When providing the intent filter to start your main activity in the wear manifest as a combination of action.Main and action.TRACK category with mime type /running, the activity will not register in the launcher with an icon, only voice action OK GOOGLE START RUNNING will launch the activity. 

<intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="vnd.google.fitness.TRACK"/>
                <data   android:mimeType="vnd.google.fitness.activity/running"/>

                <category android:name="android.intent.category.LAUNCHER" />

</intent-filter>


To get the icon back to the  launcher I had to make a compromise of loosing the ability to start the main activity with the voice launcher. 

<intent-filter>
                <action android:name="android.intent.action.MAIN" />


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