Closing a modal dialog in a delphi firemonkey mobile app (Android)

I have the most crappy time trying to understand why my modal form will not be closed! Using the Delphi XE-5 and FireMonkey Mobile App (Android), I followed the information " ShowModal Dialogs in FireMonkey Mobile Applications "

for demonstration purposes, I created a new delphi application for Firemonkey Mobile and added an additional firemonkey mobile form. From the main form, I use the code from the article:

procedure TForm1.Button1Click(Sender: TObject);
var
  Form2: TForm2;
begin
  Form2 := TForm2.Create(nil);

  Form2.ShowModal(procedure(ModalResult: TModalResult)
    begin
      if ModalResult = mrOK then
      begin
        //
      end;
      Form2.DisposeOf;
    end);

end;

modalresult "Ok" "Cancel" "mrCancel" "mrOK" . , , . onClick modalresult . ? , , , , ()?

+4
1

, :

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := TCloseAction.caFree;
end;

Form2.DisposeOf;, ModalResult .

​​ XE7, . FireMonkey.

ShowModal Android, , DisposeOf .

+5

Source: https://habr.com/ru/post/1530446/


All Articles