I have a method that returns CharSequence [] and is not empty (marked with a log), but does not appear in the dialog box. I need to initialize the boolean [] array; I do not see any error, so maybe I missed something. 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(); }
source share