Sleep not resumed (context is paused): b4a.example3.b4xloadingindicator$ResumableSub_MainLoop
The sub MainLoop is:
B4X:
Private Sub MainLoop
index = index + 1
Dim MyIndex As Int = index
Dim n As Long = DateTime.Now
Do While MyIndex = index
Dim progress As Float = (DateTime.Now - n) / duration
progress = progress - Floor(progress)
cvs.ClearRect(cvs.TargetRect)
CallSub2(Me, DrawingSubName, progress)
cvs.Invalidate
Sleep(10)
Loop
End Sub
This message is a problem? I need to worry about this? If yes, what I need to change in the code?
It is not a problem. It means that the sleep call was not resumed because the activity was paused. This is good as you don't want this loop to continue to run while the app is in the background.
Make sure to include this code in the activity:
B4X:
Sub Activity_Resume
For Each v As View In Activity.GetAllViewsRecursive
If v.Tag Is B4XLoadingIndicator And v.Visible = True Then
Dim x As B4XLoadingIndicator = v.Tag
x.Show
End If
Next
End Sub
The purpose of this code is to start the loop again.