Ok guys...I need to create a Alert dialog with 3 check boxes. If the top check box is clicked, 2 another one should be clicked and disabled !! I do them clicked, but not disabled. And i have no idea how to do that.
@Override
protected Dialog onCreateDialog (int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("AA");
builder.setMultiChoiceItems(mStrings, mCheckedItems, new DialogInterface.OnMultiChoiceClickListener() {
public void onClick(final DialogInterface dialog, int which, boolean isChecked) {
switch (which) {
case 0: {
if(isChecked==true) {
for (int i = 1; i<=2; i++) {
((AlertDialog) dialog).getListView().setItemChecked(i, true);
}
}
if (isChecked==false) {
for (int i = 1; i<=2; i++) {
((AlertDialog) dialog).getListView().setItemChecked(i, false);
}
break;
}
And this solution is not good to. Some times its not click all checkboxes. Have anybody any idea ?