Hi,
I have created the MultiChoice AlertDialog The AlertDialog has five list items with checkboxes. When I check First checkbox, w.r.t this the if the other checkboxes in the list are checked they shud be unchecked automatically and vice versa.
I am checking the isChecked status in the onClick method of OnMultiChoiceClickListener() and calling the showDialog(DIALOG_MULTIPLE_CHOICE); by updating boolean[] checkedItems; to recreate the Dialog, But I am unable to achieve it. If you any suggestions please direct me to right way.
Is there any way to recreate the AleartDialog onClick event of the radio button click.
Some Sample Code below:
case DIALOG_MULTIPLE_CHOICE:
final String[] lJobTypes = { "Item1", "Item2", "Item3","Item4", "Item5" };
return new AlertDialog.Builder(JoblistPage.this)
// .setIcon(R.drawable.logo)
.setTitle("Title Here")
// .setCustomTitle(m_Title)
.setMultiChoiceItems(lTypes, m_Selections,
new DialogInterface.OnMultiChoiceClickListener() {
public void onClick(DialogInterface dialog,int whichButton, boolean isChecked) {
/* User clicked on a check box do some stuff */
if (isChecked) {
m_CheckCount++;
//Toggle the Radio button Check status
} else {
m_CheckCount--;
}
}
}).setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
}
}).create();
Regards Vinayak
See Question&Answers more detail:os