I have developed Windows applications in Delphi for at least 15 years. I just started using 10.2 to develop a simple Android application. I discovered, quite painfully, that OpenDialog is not available on Android. It would have been nice if there had been an error message, but...

I have developed Windows applications in Delphi for at least 15 years. I just started using 10.2 to develop a simple Android application. I discovered, quite painfully, that OpenDialog is not available on Android. It would have been nice if there had been an error message, but...

I looked around and have seen people struggling with this for over 5 years. Is it really true that no one has developed a replacement for OpenDialog in all of this time?

Comments

  1. I think you need to use Dialog Services in FMX.DialogService unit.

    For example, I use the next code the confirm the delete of a document.

    TDialogService.PreferredMode := TDialogService.TPreferredMode.Platform;
    TDialogService.MessageDialog(TIntlCommon(Setup.Intl).TextAskForDelete, TMsgDlgType.mtConfirmation,
    [TMsgDlgBtn.mbOK, TMsgDlgBtn.mbCancel], TMsgDlgBtn.mbCancel, 0,
    procedure(const AResult: TModalResult)
    begin
    case AResult of
    mrOk:begin
    IfExists_LinesView_CloseIt;
    try FModel.DeleteDocument(FShowDocument);
    Search(Self);
    if FModel.TableDocumentsIsEmpty then begin
    OnClick_BtnGoSearch(Self);
    end;
    except
    on E:EscModelRecordNotFound do FView.ShowMessage(TIntlCommon(Setup.Intl).TextExceptionRecordNotFound);
    on E:EscModelDeleteImpossible do FView.ShowMessage(TIntlCommon(Setup.Intl).TextExceptionImpossibleDelete);
    on E:Exception do FView.ShowMessage(E.Message);
    end;
    end;
    end;
    end);

    ReplyDelete
  2. All very helpful comments. I have the app roughed out now. Thanks so much!

    ReplyDelete

Post a Comment