- Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebView.favoriteIcon);
-
- // Use AlertDialog.Builder to create the AlertDialog
- AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
- LayoutInflater customDialogInflater = getActivity().getLayoutInflater();
- 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() {
+ Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIcon);
+
+ // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.LightAlertDialog` 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(layoutInflater.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() {