title: getCheckedRadioButtonId() on RadioGroup unchecked value not given correct using data binding android
body: <p>I am trying to use validation on radio group. But i can see the if no radio button is not checked the return value of getCheckedRadioButtonId() is not -1. I am using databinding.</p>
  
  <p>The xml file of radio group. </p>
  
  <pre><code>&lt;RadioGroup
      android:id="@+id/LabRadioGroup"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:checkedButton="@+id/sound"&gt;
  
      &lt;RadioButton
          android:id="@+id/radio_normal"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:checked="@{Exams.result.equals(@string/Exam_Normal)?true:false}"
          android:text="Normal" /&gt;
  
      &lt;RadioButton
          android:id="@+id/radio_abnormal"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:checked="@{Exams.result.equals(@string/Exam_Abnormal)?true:false}"
          android:text="Abnormal" /&gt;
  
      &lt;RadioButton
          android:id="@+id/radio_unknown"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:checked="@{Exams.result.equals(@string/Exam_unknown)?true:false}"
          android:text="Unknown" /&gt;
  
  &lt;/RadioGroup&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lqFsc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lqFsc.png" alt="enter image description here"></a></p>
  
  <p>Here is the debug value in the screen shot.</p>
  
  <p>Java code</p>
  
  <pre><code>private boolean Validation() {
      int radiogroup = binding.LabRadioGroup.getCheckedRadioButtonId();
      if (binding.LabRadioGroup.getCheckedRadioButtonId() == -1) {
          binding.radioNormal.setError(CommonMessages.GROUP_RADIO_ERROR_TAG);
          return false;
      }
      return true;
  }
  </code></pre>