How simulate hardware back button press to close application?
I need close the application by code but Application.Terminate, Close, Hide and DisposeOf do not work.
So I thought to simulate hardware back button press to achieve my goal.
How simulate hardware back button press to close application?
I need close the application by code but Application.Terminate, Close, Hide and DisposeOf do not work.
So I thought to simulate hardware back button press to achieve my goal.
To make your application handle when users press the Back button on their Android device, add an event handler to your form for OnKeyUp, and use the following code within your event handler:
if Key = vkHardwareBack then
begin
// Do whatever you want to do here
Key := 0; // Set Key = 0 if you want to prevent the default action
end;