Starting too many activities?

这一生的挚爱 提交于 2019-12-06 03:51:34

Even there is no such limitation in activity number, it is really a bad design to create too many activities. This is mainly because each activity is assigned specified minimum memory in VM and if it has IPC call, it will spend binder buffer.

We can re-design our app to reduce the number of activity. In your case, you can try to use one activity to show the day to day schedule. If it is hard to re-use, then we can close the previous activity as soon as possible to reduce the memory usage.

While there is technically no hard limit, some devices will have problems with a larger number of activities. Some of the devices I did tests on started having problems around 8 activities or so.

There is no such limit to my knowledge. Typically applications have like 5 open activities.

It is good programming practice to keep them to a lower number

You can create as many activity in an application as you want, and how much is the device can keep running. There isn't any limit of this, but sometimes the devices can't run them. Usually you can create your application, with lower number activities, what's the better solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!