hat's what the second argument on setMultiChoiceItems
do, but you are basically passing an array of boolean values recently created (they are all false
).
Try setting the positions you want pre-checked as true
before calling setMultiChoiceItems
.
You can reuse the for
loop you already have to do something like this:
final boolean[] itemsChecked = new boolean[modes.length];
for (int i = 0; i < modes.length; i++)
{
typeOfTransport[i] = modes[i].Name;
itemsChecked[i] = modes[i].Selected;
}