I've got a single choice alert dialog working, but I can't figure out how to access to OK/Cancel event to return my selected item and close the alert.
Here's what I have now...
btnChooseJobType.Click += (sender, e) => {
AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.SetTitle("Make your selection");
ad.SetSingleChoiceItems(jobtypes, -1, JobTypeListClicked); //this works but I don't want it to return the value at this point.
ad.SetPositiveButton("OK", delegate....//NOT SURE WHAT TO PUT HERE...
ad.Show();
};
private void JobTypeListClicked(object sender, DialogClickEventArgs eventargs)
{
Toast.MakeText(this, string.Format("Job Type: {0}", jobtypes[eventargs.Which]), ToastLength.Short).Show();
}
The toast shows me the result when I select it, but I need to return the value to the parent activity when the OK button is clicked.
Thanks!