Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Timer1 As Timer
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Timer1.Initialize("Timer1_Tick", 500)
If File.Exists(File.DirApp, "flag1.txt") = True Then
File.WriteString(File.DirApp, "flag1.txt","")
Sleep(1000)
If File.ReadString(File.DirApp, "flag1.txt").Length <>0 Then
xui.MsgboxAsync("The program was launched earlier!", "Attention !")
Sleep(2000)
ExitApplication
Else
Timer1.Enabled = True
End If
Else
xui.MsgboxAsync("File flag1.txt not found!", "START")
End If
End Sub
Private Sub Timer1_tick_tick
File.WriteString(File.DirApp, "flag1.txt","bla... bla... bla...")
End Sub