- // Get the activity's layout inflater.
- LayoutInflater customDialogInflater = getActivity().getLayoutInflater();
-
- // Use AlertDialog.Builder to create the AlertDialog. The style formats the color of the button text.
- AlertDialog.Builder createHomeScreenShorcutDialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
- createHomeScreenShorcutDialogBuilder.setTitle(R.string.create_shortcut);
- createHomeScreenShorcutDialogBuilder.setIcon(favoriteIconDrawable);
- // The parent view is "null" because it will be assigned by AlertDialog.
- createHomeScreenShorcutDialogBuilder.setView(customDialogInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null));
+ // 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));