title: Submit Ration Button Value to Firebase
body: <p>i have created a Form in my app. There is 3 things Mobile , Amount and <code>Radio Button</code> with 2 values (Male and Female) . when i press the submit <code>Button</code> Mobile and Amount save to <code>Database</code> But <code>RadioButton</code> values doesn't save .But when i double press on the <code>Radiobutton</code> its save the vale . I want the it will save when submit button is pressed.</p>
  
  <p>Here is the code : </p>
  
  <pre><code>  private void Submit() {
              String Mobile = mobile.getText().toString().trim();
              String Amount = amount.getText().toString().trim();
  
              if (TextUtils.isEmpty(Mobile)) {
                  Toast.makeText(this, "Please enter Mobile", Toast.LENGTH_LONG).show();
                  return;
              }
  
              if (TextUtils.isEmpty(Amount)) {
                  Toast.makeText(this, "Please enter Amount", Toast.LENGTH_LONG).show();
                  return;
              }
  
              demoRef.push().child("Mobile").setValue(Mobile);
              demoRef.push().child("Amount").setValue(Amount);
  
              radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  
                  @Override
                  public void onCheckedChanged(RadioGroup radioGroup, @IdRes int i) {
                      switch (i){
                          case R.id.male:
                              demoRef.push().child("Method").setValue("Male");
                              break;
                          case R.id.female:
                              demoRef.push().child("Method").setValue("Female");
                              break;
  
                      }
  
                  }
              });
  </code></pre>