Creating an AlertDialog with a list
I don't know how many times you wish to use this on your project so I tested and I suggest you to first extract the list from the method context and receive it as argument.    

public void showAlertDialogWithList(List&lt;String&gt; mAnimals) {

    final CharSequence[] animals = mAnimals.toArray(new String[mAnimals.size()]);
    AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
    dialogBuilder.setTitle("Animals");
    dialogBuilder.setItems(animals, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            String selectedText = animals[i].toString();
            Toast.makeText(getApplicationContext(), selectedText, Toast.LENGTH_SHORT).show();
        }
    });

    AlertDialog alertDialogObject = dialogBuilder.create();
    alertDialogObject.show();
}


Then you can extract a class and put it in some util package making it available to entire project like this one:    

public class AlertDialogList {
    public static void showAlertDialogWithList(String title, List&lt;String&gt; mAnimals, final Activity activity) {

        final CharSequence[] animals = mAnimals.toArray(new String[mAnimals.size()]);
        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
        dialogBuilder.setTitle(title);
        dialogBuilder.setItems(animals, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                String selectedText = animals[i].toString();
                Toast.makeText(activity.getApplicationContext(), selectedText, Toast.LENGTH_SHORT).show();
            }
        });

        AlertDialog alertDialogObject = dialogBuilder.create();
        alertDialogObject.show();
    }
}


and use it like this

 AlertDialogList.showAlertDialogWithList("Animals Title", this.animals, this);