+ // Set an `onClick` listener on the negative button.
+ dialogBuilder.setNegativeButton(R.string.ok, (DialogInterface dialog, int which) -> {
+ // Inform the parent activity that the dialog was closed.
+ downloadLocationPermissionDialogListener.onCloseDownloadLocationPermissionDialog(downloadType);
+ });
+
+ // Create an alert dialog from the builder.