I am looking at the https://developer.android.com/topic/libraries/architecture/saving-states. It mention of "system-initiated process death". What does it actually mean?
Android : What does system-initiated process death mean?
Quoting the documentation:
In most cases, every Android application runs in its own Linux process. This process is created for the application when some of its code needs to be run, and will remain running until it is no longer needed and the system needs to reclaim its memory for use by other applications.
(emphasis added)
If your app is not in the foreground, the system can terminate your process at any point to free up system RAM for use by other processes. The page that you linked to has information about saving activity states for a short while (via onSaveInstanceState()
), in case the user happens to return to your app fairly quickly, yet Android terminated your process in the meantime.
do you know how to simulate the "process death"? –
Huffman
@KirillVashilo: I usually use
adb shell am kill your.application.id.goes.here
, where you would replace your.application.id.goes.here
with your application ID. This is not completely identical to what the "out-of-memory killer" does, but it is about as close as I have found. –
Senility © 2022 - 2024 — McMap. All rights reserved.