stationRadioGroup = (MyRadioGroup) view.findViewById(R.id.rg_fssxt);
stationRadioGroup.setOnCheckedChangeListener(this);
@Override
public void onCheckedChanged(MyRadioGroup group, int checkedId) {
station=((RadioButton)view.findViewById(checkedId)).getText().toString();
obtid = ConvertUtil.getObtid(station);
initView();
}
这里的initView()方法被执行三次,我想让它执行一次,求解决
2种方式:
1、别用RadioGroup监听checked方法,用里面的RadioButton监听事件
2、别用RadioGroup的check方法选中,用RadioButton的setChecked(true)的方式选中
试了标识的方法实现还是没能解决。最后放弃了RadioGroup的方法,选择对每个RadioButton监听。