In my application I have about a dozen of Activities. However, most of these have some shortcut-buttons, so the user can start the most important ones from anywhere in the app. This means, that the user can just jump around the app., filling up the Activitiy Stack with Activities. I can't change this behaviour, because I need the history function the stack provides (so I can't just use the noHistory option).
Obviously, I'd like to do something against this possible memory leak. Is it possible to remove the entry from the bottom of the Activity Stack, if the stack's size is greater than a certain number? So the stack only remembers the newest X (e.g. 30) Activity?
Thanks
Obviously, I'd like to do something against this possible memory leak.
What possible memory leak? Android will destroy activities as needed to reclaim memory. If the user BACK-buttons their way to one Android destroyed, the activity will be recreated with its original Intent
and passed the Bundle you filled in via onSaveInstanceState()
.
Is it possible to remove the entry from the bottom of the Activity Stack, if the stack's size is greater than a certain number? So the stack only remembers the newest X (e.g. 30) Activity?
Not that I am aware of. Again, you should not need it.