How to get selected item of a singlechoice Alert Dialog?

后端 未结 7 1792
故里飘歌
故里飘歌 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条回答
  •  既然无缘
    2020-12-23 14:25

    position of the selected element is already given in the onClick method. so we can directly access the the array and get the selected item without any hassle. in this case: seq[which] will be the selected item.

提交回复
热议问题