AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setItems(new CharSequence[]{"Item 1","Item 2","Item 3"}, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Do something when an item is selected } }); AlertDialog dialog = builder.create(); dialog.show();In the above code, we first create an AlertDialog.Builder object and then set the list of items using the setItems method. We also define an OnClickListener to perform some action when an item is selected. Finally, we create the dialog and show it. This method is a part of the android.app package library.