如何解决应用程序抽屉中没有显示应用程序图标的问题? [英] How to fix not show application icon into app drawer?

查看:101
本文介绍了如何解决应用程序抽屉中没有显示应用程序图标的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我希望使用深度链接。在启动器activity中为深度链接intent-filter添加intent-filter时,应用程序图标已消失应用程序图标抽屉
但当移除直接链接intent-filter将应用程序图标显示到应用程序抽屉时。

货单编码:

<activity android:name=".Pages.Splash.SplashPage">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
        <!-- DeepLink -->
        <action android:name="android.intent.action.VIEW" />

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

        <data
            android:host="www.example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />
        <data
            android:host="example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />

    </intent-filter>
</activity>

使用上述代码时,不会在应用程序抽屉中显示应用程序图标,而是从manifest显示图标中删除以下代码。

        <!-- DeepLink -->
        <action android:name="android.intent.action.VIEW" />

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

        <data
            android:host="www.example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />
        <data
            android:host="example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />

我希望打开用户单击链接时,首先启动启动程序activity,然后动态打开另一个activity

我如何修复它?

推荐答案

您应该创建两个单独的意图筛选器。在<activity/>标记中尝试以下代码:

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

    <!-- DeepLink -->
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

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

        <data
            android:host="www.example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />
        <data
            android:host="example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />

    </intent-filter>

最后,您的代码如下所示:

<activity android:name=".Pages.Splash.SplashPage">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

    <!-- DeepLink -->
    <intent-filter>

        <action android:name="android.intent.action.VIEW" />

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

        <data
            android:host="www.example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />
        <data
            android:host="example.com"
            android:pathPrefix="/gaming"
            android:scheme="http" />

    </intent-filter>
</activity>

这篇关于如何解决应用程序抽屉中没有显示应用程序图标的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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