Jump to content
Sign in to follow this  
Levente

Application terminate on Android/iOS

Recommended Posts

What is the best way to close the application completely under Android and iOS operating system.
The application was developed for remote control of a device, the user must exit the application after completing the control task and the application can no longer run in the background.

 

It doesn't work:

 

procedure TMain.btn_ExitClick(Sender: TObject);

begin

  IdIOHandlerStack1.Close;

  Application.Terminate;

end;

Share this post


Link to post

not sure about your apples but killed my robots like this..

 

  {$IFDEF ANDROID}
  ReleaseWakeLock;
  MainActivity.finish;
  {$ENDIF}

 

dave

Share this post


Link to post

For Android, this is the only way I've found that will quit completely and remove the task from the "recent items" list:

 

https://github.com/DelphiWorlds/Kastri/blob/64a5600e0845862f3e3991cd1708dee82a65ff45/Core/DW.Android.Helpers.pas#L561

 

For iOS, it's bound to have your app rejected if it is on the App Store, otherwise:

 

https://developer.apple.com/library/archive/qa/qa1561/_index.html

 

Edited by Dave Nottage
  • Like 2
  • Thanks 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×