Good morning, I have the following Dialog with Multiple Checkboxes Selection List, How can I make it so that when I call the Dialogue, I show myself with check some items? for example, if I want to load with check item 5 and item 9, how can I do?
public AlertDialog listDialogHimnos() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
final String[] listitems = ListaHimnos.arreglo.tokens;
builder.setTitle("Himnos 1 - 371")
.setMultiChoiceItems(listitems, null, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
if (isChecked) {
//Si hay check
} else {
//Si se quita el check
}
}
});
return builder.create();
}