'====A_Activity=======
Sub Activity_Create(FirstTime As Boolean)
StartService(TimeService)
End Sub
'====TimeService=======
Sub Process_Globals
Dim wifi As MLwifi
Dim count as int = 0
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StopAutomaticForeground
count = count + 1
log(count)
DateTime.DateFormat = "HH:mm:ss dd-MM-yyyy"
Dim current_date As Long = DateTime.Now
Log(DateTime.Date(current_date))
Dim p As Period
p.Seconds = 3
Dim mm As Long = DateUtils.AddPeriod(current_date, p)
StartServiceAt("",mm,True)
IF wifi.isOnline = False then
StartActivity("B_Activity")
End if
End Sub
Sub Process_Globals
Dim TimerClose As Timer
End Sub
'====B_Activity=======
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("B_Activity")
TimerClose.Initialize ("TimerCloseQ",5000)
TimerClose.Enabled = True
End Sub
Sub TimerCloseQ_Tick
If TimeService.wifi.isOnline = True Then
Activity.Finish()
End If
End Sub