i have a method that returns the CharSequence[] and is not empty(checked with log) but is not displayed in the dialog. do i have to initalize the boolean[] array; i dont see any mistake so maybe there is something i miss. my code is:
dbManager.open();
final CharSequence[] usrCats = dbManager.getUserCreatedCategories();
dbManager.close();
final boolean[] selections = new boolean[usrCats.length];
alert = b.setTitle(R.string.remove_category)
.setMessage(R.string.delete_categories_msg)
.setMultiChoiceItems(usrCats, selections, new DialogInterface.OnMultiChoiceClickListener(){
public void onClick(DialogInterface dialog, int which, boolean isChecked){
}
})
.setPositiveButton("Create", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which){
}
}).create();
}
I don't know why but setMessage
and setMultiChoiceItems
cannot work together. When I remove the setMessage
, the list displays just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With