You should be able to do something like:
final CharSequence[] items = {"Foo", "Bar", "Baz"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Make your selection");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
// Do something with the selection
}
});
AlertDialog alert = builder.create();
alert.show();
This page has some other examples of different types of Dialogs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…