tôi có phương thức trả về CharSequence [] và không trống (được kiểm tra bằng nhật ký) nhưng không được hiển thị trong hộp thoại. tôi có phải bực bội mảng boolean [] hay không; tôi không thấy bất kỳ sai lầm nào vì vậy có thể có điều gì đó mà tôi bỏ lỡ. mã của tôi là:Tôi không thể hiển thị danh sách trong hộp thoại có setMultiChoiceItems trong Android
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();
}
Lỗi là gì? – JoxTraex
hộp thoại và nút được hiển thị nhưng không có danh sách –