Wednesday, 13 January 2016

Android Alert multiple-choice or single-choice list doesn't show


I did everything I can do to follow the example here:

http://developer.android.com/guide/topics/ui/dialogs.html

But the list didn't show.


    alertDialogBuilder.setMessage(message);
    alertDialogBuilder.setSingleChoiceItems(choiceList, -1, new DialogInterface.OnClickListener() {
        @Override        public void onClick(DialogInterface dialog, int which) {
            alertChoiceListCallBack.choiceClicked(which, true);
        }
    });


Reason:

SetMessage and setSingleChoiceItems are conflict with each other, if you want to show choice, you should give up message.








No comments:

Post a comment