title: Hiding a RadioButton in Android
body: <p>I want to set the visibility of a RadioButton to INVISIBLE or GONE. For some reason this isn't working.</p>
  
  <pre><code>RadioButton myRadioButton = (RadioButton) findViewById(R.id.my_radio_button_id);
  myRadioButton.setVisibility(View.GONE);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>myRadioButton.setVisibility(View.INVISIBLE);
  </code></pre>
  
  <p>No error is returned, it just doesn't do anything.</p>
  
  <p>However I have tried this on the RadioGroup</p>
  
  <pre><code>RadioGroup myRadioGroup = (RadioGroup) findViewById(R.id.radiogroup_quiz_answers);
  myRadioGroup.setVisibility(View.INVISIBLE);
  </code></pre>
  
  <p>And it works fine to hide the whole group. Is there a way to just hide one of the RadioButtons? I have a group of 3 which are answers to questions but in some cases I want to hide the last one.</p>