Android的,活动的无限数量的项目和活动的生命周期!生命周期、数量、项目、Android

2023-09-12 04:47:57 作者:寂寞在尖訆

几天前我发表了我的应用程序在Android市场和问题,设计和开发应用程序过程中进入了我的脑海里。这个问题是关于限制活动的数量或unlimitation。

Some days ago I have published my application in Android Marketplace and a question came into my mind during designing and developing application. This question is about limitation or unlimitation of number of activities.

例如,我的应用程序包括37活动。难道这么多?我想知道的游戏如愤怒的小鸟,它拥有超过200的水平,它拥有200个活动?!!

For example, my application includes 37 activities. Is it so much? I want to know for a game such as "Angry Birds" which has more than 200 levels, it has 200 activities?!!

我的下一个问题是,假设我设计其中包括100个活动的应用程序。用户启动应用程序和GOS到最后一项活动(如看书)。如果用户想关闭应用程序他该怎么办? 100次preSS他色器件返回键? 如果我想要把关闭按钮(帮助用户)在选项菜单中,我要重复它的每一项活动?因为据我所知,每个活动都有自己的菜单。

My next question is, assume that I am designing an application which includes 100 activities. User starts application and gos into last activity (such as reading a book). If user wants to close the application what should he do? 100 times press back key on his devise?! If I want to put close button(to help user) in options menu, do I have to repeat it for each activity? because as far as I know each activity has its own menu.

如果我把关闭按钮在最后一项活动和用户点击就可以了,程序会关闭。会发生在其他99活动是什么?他们仍然存在栈?或者当我关闭应用程序,与该包中的所有活动将删除堆栈。

If i put close button in last activity and user clicks on it, program will close. What will happen to other 99 activities? are they still exist in stack? or When I close an application, all activities related to that package will delete from stack.

我看了搭载Android 公布活动页面,但我找不到找不到我的答案。

I have read activities page published by Android but I couldn't find my answers.

很抱歉,如果上面的问题是愚蠢的问题:) 谢谢

Sorry if above questions are stupid questions :) Thank you

推荐答案

在ANRY Bairds的情况下,我怀疑他们有活动100S,我认为他们只是有一个(或可能是一对夫妇)的水平,另一个用于欢迎屏幕 - 不同程度取决于传递给活动的一些参数可能正在装载

In the case of Anry Bairds, I doubt they have 100s of activities, I think they just have one (or possibly a couple) for levels and another for the welcome screen - different levels are probably loaded depending on some parameter that was passed to the activity.

至于如何处理的负载活动100S,首先,它很可能,该系统将回收旧的堆栈的底部之前,你到100的活动。如果不是,那么是的,你的用户必须点击回过100的活动。

As for how to handle 100s of loaded activities, first of all, it is very likely that the system will recycle the old ones at the bottom of the stack before you get to the 100th activity. If not, then yes, your user will have to click back through a 100 activities.

如果你想改变什么样的后退按钮的行为,可以覆盖的onkeydown()。

If you want to change the behaviour of what the back button, you can override onKeyDown().

或者,如果你想改变的是如何活动推出的默认行为,然后看看的活动启动模式。

Or if you want to change the default behaviour of how activities are launched, then take a look at activities launch mode.