Hello is it possible to start like too many activities during the runtime of an application?
I’m developing a schedule application where you can slide from day to day where each day is a new activity. Now I’m wondering if there is a limit somehow of the number of activities you should start max. As when sliding a bit around you are soon to about 20 activities which are active.
I know activities will be killed when other applications need memory but while testing and closing the application by pressing the home button with about 20 activities ‘running’ htc sense seems to be restarting like it was closed due to a lack of free memory. When I just have a few activities running this doesn’t happen. (htc desire)
Can this be caused by starting too many activities? If so, is there a ‘limit’ of amount of activities you should start max?
Edit: I read somewhere that the twitter for android app is developed by google. But in that application you can have like unlimited number of activities running also.
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.