首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >应用程序没有出现在华为手表2的应用菜单中

应用程序没有出现在华为手表2的应用菜单中
EN

Stack Overflow用户
提问于 2019-05-20 12:53:42
回答 1查看 226关注 0票数 0

我正在Android中实现一个应用程序。我在使用我的华为手表2时遇到了问题。这个应用程序运行得很好,但我不明白为什么它没有出现在手表的应用菜单中。

去设置->应用程序和通知->信息应用程序,我看到了我的应用程序。

发生了什么,我该怎么解决呢?

这是我的Manifest.xml文件:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.prova._poc">

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@android:style/Theme.DeviceDefault"
        tools:ignore="GoogleAppIndexingWarning"
        tools:targetApi="ice_cream_sandwich">

        <service
            android:name=".MyfirebaseMessagingService" android:exported="false" >
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>

        <service
            android:name=".MyFirebaseInstanceIDService" android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
            </intent-filter>
        </service>

        <uses-library
            android:name="com.google.android.wearable"
            android:required="true" />
        <!--
               Set to true if your app is Standalone, that is, it does not require the handheld
               app to run.
        -->
        <meta-data
            android:name="com.google.android.wearable.standalone"
            android:value="true" />

        <!-- [START fcm_default_channel] -->
        <!-- [START fcm_default_channel] -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/default_notification_channel_id" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />

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

                <data
                    android:host="gizmos"
                    android:scheme="example" />
            </intent-filter>
        </activity>
        <activity android:name=".Splash">

            <intent-filter>
                <action android:name="Splash" />
                    <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>

</manifest>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-20 14:53:02

您的主要Activity清单条目是错误的。具体来说,要使它出现在任何安卓设备上的应用程序启动程序中,它需要一个如下所示的<intent-filter>元素:

代码语言:javascript
复制
<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

我不知道为什么会有所有其他的东西,但是如果您需要它,为它创建第二个<intent-filter>元素。您可以有几个意图--为给定的<activity>筛选器,匹配不同的意图--但是用于启动程序的过滤器应该只包含--仅--包含这里显示的actioncategory

更多信息在这里:https://developer.android.com/guide/components/intents-filters.html

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56221438

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档