本文介紹了如何解決應(yīng)用程序抽屜中沒有顯示應(yīng)用程序圖標(biāo)的問題?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
在我的應(yīng)用程序中,我希望使用深度鏈接。在啟動(dòng)器activity
中為深度鏈接intent-filter
添加intent-filter
時(shí),應(yīng)用程序圖標(biāo)已消失應(yīng)用程序圖標(biāo)抽屜!
但當(dāng)移除直接鏈接intent-filter
將應(yīng)用程序圖標(biāo)顯示到應(yīng)用程序抽屜時(shí)。
貨單編碼:
<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>
使用上述代碼時(shí),不會(huì)在應(yīng)用程序抽屜中顯示應(yīng)用程序圖標(biāo),而是從manifest
顯示圖標(biāo)中刪除以下代碼。
<!-- 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" />
我希望打開用戶單擊鏈接時(shí),首先啟動(dòng)啟動(dòng)程序activity
,然后動(dòng)態(tài)打開另一個(gè)activity
。
我如何修復(fù)它?
推薦答案
您應(yīng)該創(chuàng)建兩個(gè)單獨(dú)的意圖篩選器。在<activity/>
標(biāo)記中嘗試以下代碼:
<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>
這篇關(guān)于如何解決應(yīng)用程序抽屜中沒有顯示應(yīng)用程序圖標(biāo)的問題?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,