Skip to content

Instantly share code, notes, and snippets.

@DelphiWorlds
Created January 15, 2021 22:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DelphiWorlds/e4e4b8d9fb6c033dfcd99e23af1e4efa to your computer and use it in GitHub Desktop.
Save DelphiWorlds/e4e4b8d9fb6c033dfcd99e23af1e4efa to your computer and use it in GitHub Desktop.
Put application in background on Android
uses
Androidapi.Helpers;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
begin
if key = vkHardwareBack then
begin
Key := 0;
TAndroidHelper.Activity.moveTaskToBack(True);
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment