//获取性别
group0.setOnCheckedChangeListener(new MultiLineRadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(MultiLineRadioGroup group,int checkedId_sex) {
RadioButton radioButton = findViewById(checkedId_sex);
string_sex = radioButton.getTag().toString();
PreferenceUtil.getInstance().saveIntByUserId("checkedIds",checkedId_sex);
PreferenceUtil.getInstance().saveStringByUserId("string_sex",string_sex);
}
});
//保存性别
int checkedId1 = PreferenceUtil.getInstance().getIntByUserId("checkedIds", 0);
if (checkedId1!=0){
RadioButton radioButton1 = findViewById(checkedId1);
radioButton1.setChecked(true);
}`在这里插入代码片
`