Delphi 10.4.2 FMX: How to write the case where the user press return button on android phone instead of choice in message dialog box?

  

MessageDlg(‘Please turn on your gps’, TMsgDlgType.mtConfirmation,
[
TMsgDlgBtn.mbYes,
TMsgDlgBtn.mbNo,
TMsgDlgBtn.mbClose
], 0,
procedure(const AResult: TModalResult)
begin
case AResult of
mrYES: begin
LIntent := TJIntent.JavaClass.init(TJSettings.JavaClass.ACTION_LOCATION_SOURCE_SETTINGS);
TAndroidHelper.Context.startActivity(LIntent);
end;
mrNo:
Close;
mrClose:
Close;
mrNone:
Close;
end;
end);

Here are some code snippet I have been trying, I don’t want to let the user proceed and close the app when the user click return button on the phone.

Comments are closed.