What I'm trying to accomplish: When the user clicks a specific RadioButton, a TextView should appear immediately below the selected RadioButton.
My solution so far: Code-wise, put a TextView inside of the RadioGroup and set it's initial visibility to "invisible". Then, when a specific RadioButton is clicked, set the hidden TextView's visibility to "visible". When the RadioButton is unselected, hide the TextView. Setting the TextView's visiblity is done within an Activity class I've defined.
So, in my example XML code below, when "radio_button_one" is selected, "my_sometimes_hidden_textview" should appear. Conversely, when "radio_button_one" is deselected (or not selected), "my_sometimes_hidden_textview" should have it's visibility set to "invisible".
Question: Is putting the TextView inside of the RadioGroup valid (or, good practice)? If not, is there a better way to do what I'm trying to accomplish? I'm relatively new to Android development, so if there is something in the official Android documentation that I missed please point me to it. Thanks for the insight in advance.
main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#FFFFFF"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/my_always_visible_textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="This textview is always visible" />
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10px">
<RadioButton
android:id="@+id/radio_button_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Radio Button 1" />
<TextView
android:id="@+id/my_sometimes_hidden_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This should only appear when radio_button_one is selected" />
<RadioButton
android:id="@+id/radio_button_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Radio Button 2" />
</RadioGroup>
</LinearLayout>