title: How to get radio button's id and convert to string?
body: <p>I am working in Android Studio and am trying to get the ID of the selected radio button and then store the ID in a string. Is this possible?</p>
  
  <p>I have tried replacing the .getText() method below with .getId() but it wont let me store it as a string:</p>
  
  <pre><code>    RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
      radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  
          @Override
          public void onCheckedChanged(RadioGroup radioGroup, int checkedId)
          {
              RadioButton checkedRadioButton = (RadioButton) findViewById(checkedId);
              String text = checkedRadioButton.getText().toString();
              Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();
          }
      });
  </code></pre>