RaidoButton产生的bug
2015-09-01 23:06
746 查看
在用RadioButton做一些单项选择的需求时,有人可能会取下面监听器的的checkedId.
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.rgReason);
radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
Log.i("=======", checkedId+"");
}
});
;殊不知这里有一个天大的坑,如果xml里不给RadioButton设置id导致每次重新进入页面给到的checkedId都会递增,很无语.
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.rgReason);
radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
Log.i("=======", checkedId+"");
}
});
;殊不知这里有一个天大的坑,如果xml里不给RadioButton设置id导致每次重新进入页面给到的checkedId都会递增,很无语.
相关文章推荐
- WinMain
- [翻译] SSKeychain
- Again Palindromes
- Address already in use: make_sock: could not bind to address 0.0.0.0:80
- doesn't contain a valid partition table 解决方法
- ezjailserver备份和恢复方法
- 人工智能学习梵高,毕加索风格,画出的世界名画是什么样子
- Invalid file name: must contain only[a-z0-9_.]
- Aircrack-ng之Airolib-ng命令
- Factorial Trailing Zeroes
- 第一篇 演示如何访问 Email 字段 并调用出来
- hot code replace failed
- CodeForces 8A - Train and Peter
- RAID
- main/int main/void main
- 62.在设置autolayout时候 constrain to margins 和 Update Frames 这两项是什么意思?
- Tornado之main文件
- 41.【xcode】错误之Could not launch "" failed to get the task for process
- Socket连接出现大量的FIN_WAIT_2状态
- HDU1022 - Train Problem I (模拟)