- // Use AlertDialog.Builder to create the AlertDialog. The style formats the color of the button text.
- AlertDialog.Builder createBookmarkDialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowser_AlertDialog);
- createBookmarkDialogBuilder.setTitle(R.string.create_bookmark);
- createBookmarkDialogBuilder.setIcon(favoriteIconDrawable);
- // The parent view is "null" because it will be assigned by AlertDialog.
- createBookmarkDialogBuilder.setView(customDialogInflater.inflate(R.layout.create_bookmark_dialog, null));
-
- // Set an onClick listener on the negative button.
- createBookmarkDialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+ // Set an `onClick()` listener for the negative button.
+ dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {