Detecting when user turns off phone or reboots it

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

In my app is there a way to detect if a user turns the phone off or reboots it?

If there is I would like to delete a text file at that time like:

B4X:
    File.Delete(File.DirDefaultExternal, "MasterControl.txt")

Thanks.
 

rleiman

Well-Known Member
Licensed User
Longtime User
Hi,

Thanks for the reply.

I searched the forum for "run at boot" and found it needed to go here:

B4X:
#Region Module Attributes
   #StartAtBoot: True
#End Region
 
Upvote 0
Top