I am trying to get the value for the selected item within the array. This is my code:
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();
How do I get the value of the selected item and display it within a Toast? Thank you in advance.