@Override
  public void onStart() {
    super.onStart();

    AlertDialog dlg = (AlertDialog) getDialog();
    dlg.getButton(DialogInterface.BUTTON_NEGATIVE)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                mCancelled = true;
                dismiss();
              }
            });
  }
  @Override
  public void onDismiss(DialogInterface dialog) {
    if (mCancelled && mCancelRoute) RoutingController.get().cancel();

    super.onDismiss(dialog);
  }