在一个Android应用程序中,可以存在多个Main Activity吗
我希望有人能帮忙。在Android清单文件中,我们可以指定多个Activity作为主Activity吗?
I hope someone will help. In Android manifest file, can we specify more than one activity as the main activity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,你可以。但您应该通过
CATEGORY_DEFAULT
将其定义为默认值。如果没有默认的主活动,如果您有两个活动,Android Market 不知道要启动哪个活动。您必须将
action=MAIN
和category=LAUNCHER
设置为启动器中显示的入口点。Yes you can. But you should define one as default by
CATEGORY_DEFAULT
. Without default main activity if you have two activities, Android Market do not know what activity to start.You have to set
action=MAIN
andcategory=LAUNCHER
to be your entry point showed in launcher.是的,您可以拥有多个
main
活动,也可以拥有多个launcher
活动,但如果您这样做,您将在应用程序抽屉中看到尽可能多的图标。Yes you can have more than one
main
activity and you can have multiplelauncher
activities but if you do so, you will see as many icons in the applications drawer.如果您认为您的应用程序中有多个入口点,那为什么不呢?
If you think you have several entry points in your application then why not?