Reputation: 2335
I have an ArrayList of custom model called Grade. This model contain getName() method that returns the name of the grade.
My requirements are to
Use this ArrayList's Grade medel's getName() method to create Alert Diolog's setSingleChoiceItems() by passing gradeNames array.
And also I want to get the selected item(Whole Grade model) back when I select on some item on the list that displayed on AlertDialog.
builder.setSingleChoiceItems(gradeNames, -1, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//**Here I want to get selected item back as "Grade" Object
notifyDataSetChanged();
}
});
Please help me to salve this.
Thank you!
Upvotes: 0
Views: 552