- // Remove the warning below that `getActivity()` might be null;
- assert getActivity() != null;
-
- // Get the activity's layout inflater.
- LayoutInflater layoutInflater = getActivity().getLayoutInflater();
-
- // Use an alert dialog builder to create the alert dialog.
- AlertDialog.Builder dialogBuilder;
-