簡體   English   中英

如何修復未在應用程序抽屜中顯示應用程序圖標?

[英]How to fix not show application icon into app drawer?

在我的應用程序中,我想使用deeplink 當在啟動器activity添加用於深層鏈接的 intent-filter 器時 ,應用程序圖標進入應用程序抽屜
但是當刪除deeplink 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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM