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