Cпособ заблокировать кнопку back, чтобы при ее нажатие появлялось окно с запросом на выход.
Автор Рустам А.
В uses нужно добавить FMX.Platform, FMX.VirtualKeyboard!
Вот кусок кода для Delphi XE5 (немного изменил):
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); var FService : IFMXVirtualKeyboardService; begin
if Key = vkHardwareBack then
begin
TPlatformServices.Current.SupportsPlatformService(IFMXVirtualKeyboardService, IInterface(FService));
if (FService <> nil) and (vksVisible in FService.VirtualKeyBoardState) then
begin
//
end else
begin
if MessageDlg('Хотите выйти?', TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbOK, TMsgDlgBtn.mbCancel], -1) = mrOK then
begin
Halt(0);
end else
begin
Key := 0;
end;
end;
end;
end;