Obsolete
Status Update
Comments
en...@google.com <en...@google.com>
mr...@gmail.com <mr...@gmail.com> #2
To clarify each question:
1) This question pertains to the general case of any paused/stopped Activity. IE, typically if the system becomes low on memory a process will just be destroyed. Is there a step before that that attempts to reclaim memory by finishing paused/stopped Activities?
2) This pertains to a paused/stopped Activity in the current process (where only the current process is low on memory). IE, there are 10 activities on the stack that have not been finished. Will Android do anything to help reclaim this memory?
1) This question pertains to the general case of any paused/stopped Activity. IE, typically if the system becomes low on memory a process will just be destroyed. Is there a step before that that attempts to reclaim memory by finishing paused/stopped Activities?
2) This pertains to a paused/stopped Activity in the current process (where only the current process is low on memory). IE, there are 10 activities on the stack that have not been finished. Will Android do anything to help reclaim this memory?
lu...@gmail.com <lu...@gmail.com> #3
2015, issue is still not clarified.
pa...@gmail.com <pa...@gmail.com> #4
Google, why you still misinform developers about such important detail?
bl...@gmail.com <bl...@gmail.com> #5
This information is about one of the most important concepts of Android development. And it has been wrong for years. Everyone learns it wrong and there's no way to learn it right except some random Stackoverflow posts. Nice job Google, keep good work.
vi...@gmail.com <vi...@gmail.com> #6
OMG, I have 5 years of Android development and only now, by a pure chance, I got the right info..
bo...@gmail.com <bo...@gmail.com> #7
[Comment deleted]
pa...@gmail.com <pa...@gmail.com> #8
to vitaliy....@gmail.com
good for you
good for you
am...@gmail.com <am...@gmail.com> #9
Is this a serious channel for the problem? It's been haunting me weeks that whether on earth android os would destroy an activity instance but does not kill the app process.
ro...@mercadolibre.com <ro...@mercadolibre.com> #10
and?
bl...@gmail.com <bl...@gmail.com> #11
It's really one of the most important parts of an android development, google you really MUST delete those misleading phrases from the documentation.
sm...@google.com <sm...@google.com>
al...@booking.com <al...@booking.com> #12
The docs are up to date now.
https://developer.android.com/guide/components/activities/activity-lifecycle#asem
The system never kills an activity directly to free up memory. Instead, it kills the process in which the activity runs, destroying not only the activity but everything else running in the process, as well. To learn how to preserve and restore your activity's UI state when system-initiated process death occurs, see Saving and restoring activity state.
The system never kills an activity directly to free up memory. Instead, it kills the process in which the activity runs, destroying not only the activity but everything else running in the process, as well. To learn how to preserve and restore your activity's UI state when system-initiated process death occurs, see Saving and restoring activity state.
ri...@gmail.com <ri...@gmail.com> #13
Thank you for documentation update, but misleading information still exists:
https://developer.android.com/reference/android/app/Activity.html
"The system can drop the activity from memory by either asking it to finish, or simply killing its process, making it destroyed."
"The system can drop the activity from memory by either asking it to finish, or simply killing its process, making it destroyed."
ni...@gmail.com <ni...@gmail.com> #14
This is certainly an important issue for app design, it is good to see the documentation seems to be up-to-date. So, as a novice Android developer, I might ask what is the purpose of the component lifecycle, does it help us with memory management? It seems it could if we choose to use the event handlers to null out certain references that the next activity on the backstack doesn't need so the objects go back on the heap. A question I'd like to know is, if an activity launches another activity and itself is destroyed (and/or perhaps its UI becomes covered and invisible), would the content view that was set with setContentView() possibly automatically be de-referenced and garbage collected? It seems the lifecycle should help us reduce the max memory needed by the app, but how to exploit it is not very clear to me.
sa...@google.com <sa...@google.com> #15
Thank you for the feedback. We're closing this issue as Obsolete.
If it is still observed in the latest Android release, please open a new issue inhttps://goo.gl/TbMiIO along with a reference to this issue.
If it is still observed in the latest Android release, please open a new issue in
Description
"If an activity is paused or stopped, the system can drop it from memory either by asking it to finish (calling its finish() method), or simply killing its process. When the activity is opened again (after being finished or killed), it must be created all over."
That documentation caused the confusion describe in this stack overflow question,
Since I would imagine Dianne would have the best answer on this, can we clarify the aforementioned documentation in a such a way that it answers the following questions?
1) When, if ever, will a paused/stopped Activity in a task stack be finished?
2) Will any steps at all be taken to close old activities if an application's process becomes low on memory?