if you have the same code as the example link at top
i think the problem is here "If FirstTime Then"
if you turn your device the activity get pause and stop the recognition and if the activity will be recreated it did not start again.
did you put this code somewhere else?
Sub Process_Globals
Public ar As ActivityRecognition
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Log("Activity_Create")
If FirstTime Then
Log("FirstTime")
ar.Initialize("ar")
ar.Connect(5000) 'set the detection interval to 5 seconds.
End If
End Sub
Sub ar_Connected (Success As Boolean)
Log("ar_Connected: " & Success)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Log("Activity_Pause")
Log("ar.Stop")
ar.Stop
End Sub