i have a code like this
B4X:
Sub Process_Globals
Dim soso As AudioRecorder
Dim Timer1 As Timer
End Sub
Sub Service_Start (StartingIntent As Intent)
soso.Initialize()
Timer1.Initialize("Timer1",6000)
soso.AudioSource = soso.AS_MIC
soso.OutputFormat = soso.OF_THREE_GPP
soso.AudioEncoder = soso.AE_AMR_NB
soso.setOutputFile(File.DirRootExternal,"test.mp3")
soso.prepare
ToastMessageShow("AudioRecorder is ready to record.",False)
soso.start
ToastMessageShow("started",True)
Timer1.Enabled = True
' i want to come back here after the timer finish counting
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
'Call your stop recording method
ToastMessageShow("Recording stopped.",False)
soso.Stop
connection.
'how can i return from here to Sub Service_Start ?
End Sub