简体   繁体   English

我的Android应用未显示在应用抽屉中

[英]My Android App is not showing on the App Drawer

I have an application with a single activity: 我有一个活动的应用程序:

<activity android:name=".MainActivity"
    android:label="@string/app_name"
    android:screenOrientation="landscape"
    android:launchMode="singleTask"
    android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="com.google.intent.category.CARDBOARD" />

        <data android:scheme="myscheme" android:host="action1"/>
        <data android:scheme="myscheme" android:host="action2"/>
        <data android:scheme="myscheme" android:host="action3"/>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>

I need it to respond to myscheme:// urls, and it is working in that regard. 我需要它来响应myscheme://网址,并且它在这方面起作用。 Unfortunately, it does not show in my App Drawer. 不幸的是,它没有显示在我的应用程序抽屉中。 If I remove the android:scheme lines, then it shows on the App Drawer, but then it no longer responds to myscheme:// urls, obviously. 如果我删除android:scheme行,则它会显示在应用程序抽屉中,但是显然,它不再响应myscheme://网址。

How can I fix this activity to make it both show on the app drawer and respond to the custom urls? 如何解决此活动,使其既显示在应用程序抽屉中,又响应自定义网址?

Try splitting the intent-filter into two: 尝试将intent-filter分为两部分:

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

</intent-filter>
<intent-filter>
    <category android:name="com.google.intent.category.CARDBOARD" />
        <data android:scheme="myscheme" android:host="action1"/>
        <data android:scheme="myscheme" android:host="action2"/>
        <data android:scheme="myscheme" android:host="action3"/>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
    </intent-filter>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM