How can I achieve this goal in Delphi? What items should I use? Which units do I need to include?
Using the Android Device’s Back Button
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: In Delphi:
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;
I am writing for the Android tablet in Delphi XE7 Application. I want to turn off the homepage and back button so that no one can leave the application. I found a lot of answers, but none of them mentioned Delphi.
How can I use Delphi? To achieve this goal? What items should I use? Which units do I need to include?
From the documentation
Using the Android Device’s Back Button
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: In Delphi:< /p>
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;