I am using an alert dialog that shows a menu on the beginning of the app, I want the dialog to show me 2 values which are "name"s from an object, here is the code of the alert dialog:
public void showDialog() {
EntityType en = new EntityType();
ArrayList array = ApplicationController.entities;
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Pick one");
builder.setItems(array, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// I want to write my code here
}
});
builder.show();
}
EntityType
is my object that contain a string "name" and ApplicationController.entities
contains the array