我正在尝试获取数组中所选项目的值。这是我的代码:
final String items[] = {"Blue","Green","Orange"};
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Money Maker");
alert.setIcon(R.drawable.ic_launcher);
alert.setMultiChoiceItems(items, checkedItems, new
DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
String value = items.toString();
Toast.makeText(getApplication(), value, Toast.LENGTH_LONG).show();
}
});
alert.show();
如何获取所选项目的值并将其显示在 Toast 中?先感谢您。