How to get selected item of a singlechoice Alert Dialog?

后端 未结 7 1786
故里飘歌
故里飘歌 2020-12-23 13:42

I have this code to show a dialog with singlechoice(radio) options.

AlertDialog ad = new AlertDialog.Builder(this)
.setCancelable(false)
.setIcon(R.drawable.         


        
7条回答
  •  -上瘾入骨i
    2020-12-23 14:27

    I believe that you use an OnClickListener for setSingleChoiceItems(), to listen whenever an item has been selected; then once the user hits okay, you set that item in stone. Right now you're just passing null, so nothing you can't pick up which item was selected.

提交回复
热议问题