Saturday, April 30, 2011

[android-developers] How does the ActivityStack behave when it contains thousands of Activities?

In my app I have a about a dozen of different Activities. These
Activities are connected (can call each other with startActivity()) in
such a way, that the user can theoretically keep running in circles -
always jumping to the next Activity, never going back. Also, I really
need to maintain a proper Activity history: if the user presses the
back button, the app returns to the previous Activity, with the
previous content.

Question: Suppose the user's using the app for an extended amount of
time, going in circles between Activites as mentioned above, resulting
an ever-growing ActivityStack. Every Activity saves some state on
onSaveInstanceState() too.

- Is this a problem? (I'm afraid it is, I guess it's a memory leak to
have tens of thousands of Activity records on the stack, especially if
these save their state).
- Is there a way to limit the size of the default Android
ActivityStack's size? (size limit is X, we delete the oldest record if
it gets filled up)

Any suggestions / alternative solutions are welcome.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate