rides-android/src/main/java/com/uber/sdk/android/rides/RideRequestActivity.java
@NonNull
    private AlertDialog buildErrorAlert(
            @StringRes int messageTextId,
            @StringRes int positiveButtonTextId,
            final Intent intent) {
        return new AlertDialog.Builder(this)
                .setMessage(messageTextId)
                .setPositiveButton(positiveButtonTextId, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setResult(RESULT_CANCELED, intent);
                        finish();
                    }
                })
                .setOnCancelListener(new DialogInterface.OnCancelListener() {
                    @Override
                    public void onCancel(DialogInterface dialog) {
                        setResult(RESULT_CANCELED, intent);
                        finish();
                    }
                })
                .create();
    }
@NonNull
    private AlertDialog buildErrorAlert(
            @StringRes int messageTextId,
            @StringRes int positiveButtonTextId,
            final Intent intent) {
        return new AlertDialog.Builder(this)
                .setMessage(messageTextId)
                .setPositiveButton(positiveButtonTextId, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setResult(RESULT_CANCELED, intent);
                        finish();
                    }
                })
                .setOnCancelListener(new DialogInterface.OnCancelListener() {
                    @Override
                    public void onCancel(DialogInterface dialog) {
                        setResult(RESULT_CANCELED, intent);
                        finish();
                    }
                })
                .create();
    }
Builds an {@link AlertDialog} to the user to indicate an error and dismisses activity.

@param messageTextId the message content {@link StringRes} text ID
@param positiveButtonTextId the positive button {@link StringRes} text ID
@param intent the {@link Intent} to pass in the result
@return an {@link AlertDialog} to show