相关疑难解决方法(0)

单选按钮仅部分检查

我知道这听起来很怪异,所以这是图片.

在此输入图像描述

它保持正确的价值.选择(部分)正确的单选按钮.其中的所有逻辑OnCheckedChangeListener都正确执行.我完全惊呆了.为什么没有完全检查单选按钮?

我唯一能想到的就是我正在使用 Rx2Firebase

periodRetriever = FirebaseHelper.getInstance(getContext()).getPeriod()
        .defaultIfEmpty(0)
        .distinctUntilChanged()
        .subscribe(new Consumer<Integer>() {
            @Override
            public void accept(@NonNull Integer headerType) throws Exception {
                getRadioViewChecked(headerType).setChecked(true);
            }
        });
Run Code Online (Sandbox Code Playgroud)

EDIT1

马科斯建议我看不到白蜱.不是这种情况. 在此输入图像描述

EDIT2

布局:

<RadioGroup
    android:id="@+id/rgPeriod"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <android.support.v7.widget.AppCompatRadioButton
        android:id="@+id/rbMonth"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="false"
        android:text="@string/month" />

    <android.support.v7.widget.AppCompatRadioButton
        android:id="@+id/rbWeek"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="false"
        android:text="@string/week" />

    <android.support.v7.widget.AppCompatRadioButton
        android:id="@+id/rb4Weeks"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="false"
        android:text="@string/four_weeks" />


</RadioGroup>
Run Code Online (Sandbox Code Playgroud)

android android-layout android-radiogroup android-radiobutton

13
推荐指数
1
解决办法
1538
查看次数