Android应用程序开发:两个图标越来越创建,我只需要一个 [英] Android App Development: Two icons getting created and I only need one

查看:231
本文介绍了Android应用程序开发:两个图标越来越创建,我只需要一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个Android应用程序,有一个主要活动和一个子活动。当我在我的手机来测试它安装应用程序,我得到两个图标,而不是一个。第一个图标是主要活动,二是为子活动。我不想/需要的子活动的图标。

I am writing an Android App that has one main activity and one subactivity. When I install the app on my phone to test it out, I get two icons instead of one. The first icon is for the main activity and the second is for the subactivity. I don't want/need an icon for the subactivity.

有谁知道如何关闭这个功能在我的应用程序code,所以只安装了主要活动的图标?你可以提供的任何信息,大大AP preciated!

Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed? Any information you can provide is greatly appreciated!

谢谢, MobiKnow

Thanks, MobiKnow

推荐答案

您的应用程序清单列表下的子活动的意图过滤器相匹配的主发射?

Does your application manifest list an intent filter under your sub-activity that matches the main launcher?

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

请确保您的子活动是没有过滤这些意图。

Make sure that your sub-activity is not filtering for these intents.

编辑:只是要非常清楚,确保上面的行不会在你的子活动列出。这个意图过滤器可以让Android系统知道你打算为它被列为切入点,以您的应用程序。

Just to be very clear, make sure the above lines are not listed under your sub-activity. That intent filter lets the Android system know that you intend for it to be listed as an entry point to your application.

这篇关于Android应用程序开发:两个图标越来越创建,我只需要一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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