Hello!
I am developing an Android application using the mechanism from the demo project ForegroundLocationDemo (Delphi 12)
ForegroundLocationDemo works fine,
but I can't programmatically restore native activity from the background after reaching the target.
Please tell me how to do it so that under a certain condition (say, when a certain location is reached)
programmatically bring native activity out of the background in the procedure:
procedure TLocationTrackingModule.LocationSensorLocationChanged(Sender: TObject; const OldLocation, NewLocation: TLocationCoord2D);
begin
FLocation := NewLocation;
if FIsRunningInForeground then
Begin
FNotificationManager.notify(NotificationId, GetNotification);
{$REGION 'My code'}
If NewDistance <= Distance Then
Begin
StopLocationTracking; // Stopping this service turns it into only a bound service
??? // Restore native activity from background
End
{$ENDREGION 'My code'}
End
else
begin
if Assigned(FLocationUpdated) then
FLocationUpdated(NewLocation);
end;
end;