当前位置:操作系统 > 安卓/Android >>

android为RadioButton单独添加checked监听事件

 

final RadioButton red_radio = (RadioButton) findViewById(R.id.red_radio);  

        final RadioButton gray_radio = (RadioButton) findViewById(R.id.gray_radio);  

        gray_radio.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {  

            @Override 

            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {  

                red_radio.setChecked(false);  

            }  

        }); 

 

摘自 guying1028

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,