You can call a sub in the Activity which then update a UI Element.
Example from GPS Tutorial
Service Module
B4X:
Sub GPS_LocationChanged (Location1 As Location)
CallSub2(Main, "LocationChanged", Location1)
End Sub
Main Activity
B4X:
Public Sub LocationChanged(Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
lblSpeed.Text = $"Speed = $1.2{Location1.Speed} m/s "$
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.