It is a headache for me to understand what's going on returning to the app after the power-off button pressed. I ran the app step by step. Some variables are back to 0 some others not, even if they are defined and initialized on the same place. So my app crashes.
Curiously, I don't have troubles if I press the "home" button or if I receive
a phone call as my app is running. No problem with the "back arrow"... is used to exit from application.
So ! I am looking for a way to have my app to stop as soon as the power-off
button has been pressed.
... I found nothing about this on the forum.