Android APK 安装多个图标/活动? [英] Android APK installs multiple icons / activities?
问题描述
我有一个具有多种布局/活动的程序.我安装了 APK,并且在我安装的应用程序位置有 3 个应用程序图标!我以为可能是我的调试环境,但现在我知道它是由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.
是否需要设置某种参数来防止 Activity 成为启动点,还是完全不同的东西?
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屋!