Hey,
Thanks for your inputs.
I haven't been able to try the code that you suggested.
However, following is the code snippet i am using to generate multiple select check boxes in an alert dialog.
I don't see an option in the below code here.
Is implementing via a list view the only option here ??
1final List multiSelectedOptions = new ArrayList();
2 AlertDialog.Builder builder = new AlertDialog.Builder(CountryContact.this);
3 builder.setTitle(R.string.chooseChangeOpt);
4 //showListArr is an array containing strings values. Eg - "John-1" , "Mona-2"
5 builder.setMultiChoiceItems(showListArr, null, new DialogInterface.OnMultiChoiceClickListener() {
6
7 public void onClick(DialogInterface dialog, int which, boolean isChecked) {
8 if (isChecked) {
9 // If the user checked the item, add it to the selected items
10 multiSelectedOptions.add(which);
11 } else if (multiSelectedOptions.contains(which)) {
12 // Else, if the item is already in the array, remove it
13 multiSelectedOptions.remove(Integer.valueOf(which));
14 }
15 }
16 });
17 builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
18 public void onClick(DialogInterface dialog, int id) {
19 Log.i(tagName,"Clicked Items are::"+multiSelectedOptions);
20 selectedContactsForUpdate = multiSelectedOptions;
21 contactsListForUpdate = eligContactsList;
22 LoadingUpdateSelectedContacts updtSelContacts = new LoadingUpdateSelectedContacts();
23 updtSelContacts.execute();
24 }
25 });
26 builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
27 public void onClick(DialogInterface dialog, int id) {
28 }
29 });
30
31 builder.create();
32 builder.show();