@Override protected Dialog onCreateDialog(int id) { Dialog dialog = super.onCreateDialog(id); if (dialog != null) return dialog; switch (id) { case DIALOG_SUBSCRIPTION_REQUEST_ID: return new ConfirmDialogBuilder(this, DIALOG_SUBSCRIPTION_REQUEST_ID, this) .setMessage(subscriptionRequest.getConfirmation()) .create(); default: return null; } }