trexios trexios - 2 months ago 19
Android Question

Delphi XE5 Android. Hardware back button press

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.

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