How to detect the termination of a program in Android?
问题 When a Windows program terminates it calls event handlers like OnClose, OnDestroy and the destructor Destroy. When I want to save some INI settings these are the places to be. I wrote event handlers for all these events but they are not processed when I terminate the program. Does anyone know where I should place the code to be executed when an Android program terminates? I strongly suspect that this applies to iOS as well. Update Johan's answer works for Android as well, although reality is