前面也碰到过这个问题,不过后来解决了,但是没有留意解决的根本,今天网上搜索了一下,发现很多人碰到了同样的问题,不过很多人也没有找到问题的本质所在
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView==null){
LinearLayout ll = new LinearLayout(this.context);
CheckBox radioButton = new CheckBox(this.context);
radioButton.setPadding(0, 0, 0, 0);
final String key = this.keys[position];
radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(!isChecked){
datas.put(key, false);
}else{
datas.put(key, true);
}
}
});
if(!datas.get(key)){
radioButton.setChecked(false);
}else{
radioButt