yfleury Active Member Licensed User Longtime User Nov 16, 2020 #1 I have this in Starter B4X: Copy Sub GPS_LocationChanged (Location1 As Location) CallSub2(Main2, "LocationChanged", Location1) End Sub In Main2 (Activity) I have that B4X: Copy Public Sub LocationChanged(Location1 As Location) LogColor("LocationChanged ",Colors.Blue) End Sub the Sub LocationChanged is not rising even if GPS is start like this B4X: Copy Public Sub StartGps If gpsStarted = False Then GPS1.Start( 0,0) gpsStarted = True End If End Sub I want to move gps camera to follow my position
I have this in Starter B4X: Copy Sub GPS_LocationChanged (Location1 As Location) CallSub2(Main2, "LocationChanged", Location1) End Sub In Main2 (Activity) I have that B4X: Copy Public Sub LocationChanged(Location1 As Location) LogColor("LocationChanged ",Colors.Blue) End Sub the Sub LocationChanged is not rising even if GPS is start like this B4X: Copy Public Sub StartGps If gpsStarted = False Then GPS1.Start( 0,0) gpsStarted = True End If End Sub I want to move gps camera to follow my position
LucaMs Expert Licensed User Longtime User Nov 16, 2020 #2 Starts GPS_LocationChanged (add a log line)? If you use CallSub the Activity must be in foreground; try CallSubDelayed. Note that B4XPages are better. Upvote 0
Starts GPS_LocationChanged (add a log line)? If you use CallSub the Activity must be in foreground; try CallSubDelayed. Note that B4XPages are better.
yfleury Active Member Licensed User Longtime User Nov 16, 2020 #3 Thanks @LucaMs for the reply. I test that and nothing in log for CallSub ou CallSubDelayed B4X: Copy Sub GPS_LocationChanged (Location1 As Location) LogColor("StartService location change", Colors.Red) CallSubDelayed2(Main2, "LocationChanged", Location1) ' CallSub2(Main2, "LocationChanged", Location1) End Sub Upvote 0
Thanks @LucaMs for the reply. I test that and nothing in log for CallSub ou CallSubDelayed B4X: Copy Sub GPS_LocationChanged (Location1 As Location) LogColor("StartService location change", Colors.Red) CallSubDelayed2(Main2, "LocationChanged", Location1) ' CallSub2(Main2, "LocationChanged", Location1) End Sub
yfleury Active Member Licensed User Longtime User Nov 16, 2020 #4 gmap is runing fine, exept for sub locationchange Upvote 0
LucaMs Expert Licensed User Longtime User Nov 16, 2020 #5 How did you initialize the gps object? Upvote 0
yfleury Active Member Licensed User Longtime User Nov 16, 2020 #6 In Starter I have B4X: Copy Sub Process_Globals Public GPS1 As GPS Private gpsStarted As Boolean Sub Service_Create GPS1.Initialize("GPS") Upvote 0
In Starter I have B4X: Copy Sub Process_Globals Public GPS1 As GPS Private gpsStarted As Boolean Sub Service_Create GPS1.Initialize("GPS")
yfleury Active Member Licensed User Longtime User Nov 16, 2020 #7 Find the problem. My device is very near from my computer desktop and then causing interference with my gps device. When my device is going out from my computer, the locationchange is working normaly. Upvote 0
Find the problem. My device is very near from my computer desktop and then causing interference with my gps device. When my device is going out from my computer, the locationchange is working normaly.