When a process is killed (using the ATK or Android stop button, or the function here ), it is immediately cleared from memory (if the kernel allows it). This means that there is no chance to run any additional code, that is, there is no way to really deal with the βforce killβ sent to your application.
If you want to deal with this, you have 2 options (what I can think of):
- Post your opt-out statement so that users add your application to the ATK ignore list.
- Find a way to maintain functionality without relying on the onDestroy () method.
EDIT:
If you want to check your process from the list of current processes, check out getRunningAppProcesses () .
John lehehey
source share