sglei_wenmor 2016-01-20 07:55 采纳率: 0%
浏览 1440

radiogroup被执行三次,求解决

 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条回答

  • danielinbiti 2016-01-20 08:03
    关注

    2种方式:
    1、别用RadioGroup监听checked方法,用里面的RadioButton监听事件
    2、别用RadioGroup的check方法选中,用RadioButton的setChecked(true)的方式选中

    评论

报告相同问题?