繁体   English   中英

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

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

我有一个活动的应用程序:

<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>

我需要它来响应myscheme://网址,并且它在这方面起作用。 不幸的是,它没有显示在我的应用程序抽屉中。 如果我删除android:scheme行,则它会显示在应用程序抽屉中,但是显然,它不再响应myscheme://网址。

如何解决此活动,使其既显示在应用程序抽屉中,又响应自定义网址?

尝试将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