Hi,
my App run 24/7. All 30' start's a "Watchdog Service".
In this Service i check if the App Run more then 24h. If true i will Restart the App.
The Check works, the Reboot not.
my attempt
the restart in the Main (Activity)
and the Call from the Service
my App run 24/7. All 30' start's a "Watchdog Service".
In this Service i check if the App Run more then 24h. If true i will Restart the App.
The Check works, the Reboot not.
my attempt
the restart in the Main (Activity)
B4X:
Sub Reboot
Dim Writer As TextWriter
File.Delete(File.DirInternal,"RebootTime.txt")
Writer.Initialize(File.OpenOutput(File.DirInternal, "RebootTime.txt", False))
Writer.WriteLine(DateTime.Now)
Writer.Close
Activity.Finish
StartActivity(Me)
End Sub
and the Call from the Service
B4X:
StartActivity(Main) 'for test
CallSubDelayed(Main,"Reboot")