private Dialog createOkAlertDialog(int titleId, int messageId, int iconId) {
    AlertDialog.Builder builder =
        new AlertDialog.Builder(this).setMessage(messageId).setPositiveButton(R.string.ok, null);
    if (titleId != 0) {
      builder.setTitle(titleId);
    }
    if (iconId != 0) {
      builder.setIcon(iconId);
    }
    return builder.create();
  }
Create dialog with supplied ids.

@param titleId title is not set if titleId is 0.
@param messageId messageId of the message.
@param iconId icon is not set if iconId is 0.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java