0
我正在关注的Qiitanium应用程序的代码(见链接高亮行)绑定单选按钮和我有麻烦搞清楚怎么可以绑定单选按钮如何使用RxJava
说我有一个R A RadioGroup中.id.rgMyButtons作为Id,它包含3个RadioButtons“Dead”,“Alive”,“Body Missing”和Ids是R.id.rbDead,R.id.rbAlive,R.id.rbMissing
我设置了RadioGroup字段为
Rx<RadioGroup> radioGroup;
我得到在onViewCreated中设置的视图为
rdGroup = RxView.findById(this, R.id.rgMyButtons);
rdGroup.get().setOnCheckedChangeListener(mOnPersonStateUpdateListener);
在onBind中,我想将RadioGroup绑定到模型数据,以便将地图直接返回到该组中正确的RadioButton。我正在寻找像
rdGroup.bind(person.state(), RxActions.someAction()),
因此,它绑定到RadioGroup并自动设置正确的值。
person_state()实际上返回2为Dead,3为Alive,4为Missing,我希望检查RadioGroup中的正确字段。我如何在RxAndroid中实现这一点?