Dialog dla kompilacjia dla Androida

0

Witam
Przed skasowaniem rekodu chciałbym żeby user androida potwierdził swój zamiar bo jest nieodwracalny.
Android na to że jest kłopot: "Blocking dialogs not implemented on this platform."
Proszę o podpowiedź.
Pozdrawia
Piotr

if MessageDlg ('Do you want a double message?',
TMsgDlgType.mtConfirmation,
[TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo],
0) = mrYes then

ShowMessage ('Hello');
1

Możesz też skorzystać z odpowiedniego interfejsu przygotowanego pod FMX.
http://docwiki.embarcadero.com/Libraries/Tokyo/en/FMX.Platform.IFMXDialogServiceSync
oraz http://docwiki.embarcadero.com/Libraries/Tokyo/en/FMX.Platform.IFMXDialogServiceAsync.MessageDialogAsync

Użycie nie jest tak proste jak w przypadku messagedialog ale może mój testowy kod Ci podpowie jak tego używać:

procedure TfmMain.RegisterApp(Sender: TObject);
var
    vDialog: IFMXDialogServiceAsync;
begin
    if not  TPlatformServices.Current.SupportsPlatformService(IFMXDialogServiceAsync, vDialog) then
        Exit;
    vDialog.InputQueryAsync('Email',['Put your email address'],[''],
      procedure(const vMR: TModalResult; const AValues: array of string)
      begin
        if vMR <> mrOk then
          Exit;
        if AValues[0] <> '' then
        begin
            TdmRESTModul.Instance.ParamByName('email',AValues[0]);
            TdmRESTModul.Instance.Execute('registration');
        end;
      end
    );
end;
0

Dziękuje to dobra podpowiedź!

Ja używałem wcześniej:

TDialogServiceAsync.InputQuery('Enter New Item', ['Name', 'Miejsce'], ['',''], Self.OnInputQuery_Close)

Tak naprawdę szukam prostego okna dialogowego podobnego do tradycyjnego MessageDlg w którym będą dwa przyciski OK lub Cancel lub inny zestaw
teraz muszę sobie sam tworzyć na to nową formatkę.

1

To co podał @woolfik to przykład ten interfejs IFMXDialogServiceAsync ma też inne metody i chyba powinieneś użyć MessageDialogAsync.

1 użytkowników online, w tym zalogowanych: 0, gości: 1