I am trying to produce an alert diaglog with x amount of buttons.
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Please select the correct AltCode");
String btns = "";
for(iPrepack i : prepackList)
{
btns = btns + "\"" + i.getAltcode() + "\",";
}
btns = btns.substring(0, btns.length() -1);
builder.setItems(new CharSequence[]
{btns}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
pp = prepackList.get(which);
populatescreen(pp);
}
});
builder.create().show();
The issue I have is that I just get one button displayed with all my altcodes, how can I seperate these into separate buttons?