在继承RadioButton的时候,覆改构造方法的时候要确保

1
public RadioButton(Context context, AttributeSet attrs) {
        this(context, attrs, com.android.internal.R.attr.radioButtonStyle);
}

这个构造方法被调用。必须在子类中调用super(Context context, AttributeSet attrs)方法。否则RadioButton子类不能选中。