private void fuXuanKuang() {
final String[] items = { "Item1", "Item2" };
AlertDialog.Builder builder = new Builder(MainActivity.this);
builder.setIcon(android.R.drawable.ic_dialog_info);
builder.setTitle("復選框");
builder.setMultiChoiceItems(items, new boolean[] { true, false },
new OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
if (isChecked) {
}
}
});
builder.setPositiveButton("確認", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(MainActivity.this, "", Toast.LENGTH_SHORT)
.show();
}
});
builder.setNegativeButton("取消", null);
Dialog dialog = builder.create();
dialog.show();
}