If I understand correctly, while the return type of MapFragment1_MarkerClick() is expected to be Boolean, calling a resumableSub within this event (MapFragment1_MarkerClick) requires that the return type of MapFragment1_MarkerClick() to be changed to ResumableSub.
Did I miss anything? How to solve this problem?
TIA
Did I miss anything? How to solve this problem?
B4X:
Sub MapFragment1_MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click
Wait For(Sum(1, 2)) Complete (Result As Int)
Log("result: " & Result)
Log("after sum")
Return True
End Sub
Sub Sum(a As Int, b As Int) As ResumableSub
Sleep(100)
Log(a + b)
Return a + b
End Sub
TIA