Send android application in background
To send in background your Delphi application on Android you can simply call the moveTasktoBackGround method of the mainActivity class defined in the FMX.Platform.Android library.
To do this task during the application startup phase on the main form we suggest to use a timer object so that the main form can completely render before going in background.
In that way your app will be correctly shown in the Android recent/running app list.
1 2 3 4 5 6 7 8 |
uses System.classes {$IFDEF ANDROID} ,FMX.Platform.Android {$ENDIF}; procedure TfrmSrvMonitor.Timer1Timer(Sender: TObject); begin Timer1.Enabled := False; {$IFDEF ANDROID} MainActivity.moveTaskToBack(true); {$ENDIF} end; |