test power-off button...

skipsy

Member
Licensed User
Longtime User
Hello Forum,

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.

In other words : Is there any way to manage this button or check if it has
been pressed (in the resume sub) ???

Thank you.
W.W.
(I forgot to mention in my previous posts : My english is so so... my
questions might not be easy to understand)
:sign0013:
 

timo

Active Member
Licensed User
Longtime User
I usually don't worry about the way an app closes (or seems to be closed). If you save your variables values on a file by calling a sub save from Pause() and then reload them in 'If first time' (if the file exists) everything should work ok.
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
I understand but... It could be interesting to be able to check if the
power-off (or sleep) button has been pressed anyway.
Thks
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
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.

Did you check the Documentation Wiki? Tricks Of The Trade - Basic4android Wiki
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
No I didn't.
Very interesting, thank you.
WW
 
Upvote 0
Top