Android APK安装了多个图标/活动? [英] Android APK installs multiple icons / activities?

查看:105
本文介绍了Android APK安装了多个图标/活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,它具有多种布局/活动.我安装了APK,并且在已安装的应用位置中有3个APP图标!我以为这可能是我的调试环境,但现在我知道这是由APK包引起的.这些图标似乎包含了我在程序中拥有的某些活动/布局的名称.我只想要一个启动点,一个应用程序显示.它确实搞砸了,因为如果我单击了错误的图标,它将使程序崩溃.

I have one program that has multiple layouts/activities. I install the APK and i have 3 APP icons in my installed apps location! I thought it was maybe my debugging environment, but now I know it's caused by the APK package. The icons seem to have the names of some of the activities/layouts I have within the program. I only want one launch point, one application to show. It really screws things up, because if I click the wrong icon, it crashes the program.

是否要设置某种参数以防止活动成为启动点,或者它完全不同?

Is there some sort of parameter to set to prevent an activity from becoming a launch point, or is it something completely different?

推荐答案

您应编辑清单文件,并从所有不想由启动器显示的活动中删除intent-filter条目.因此,请保持以下状态:

You shall edit your manifest file and remove intent-filter entry from all activities you do not want to be shown by launcher. So keep this:

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

仅适用于您想成为入口点的那个人.

only for that one you want to be your entry point.

这篇关于Android APK安装了多个图标/活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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