title: How to hide next button and show when radio group button is selected
body: <p>How to I hide the next button and will only show when the user choose a radio group button</p>
  
  <p>I have this XML code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
  
      &lt;RadioGroup
          android:id="@+id/radioSex"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;
  
          &lt;RadioButton
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/assembly"
              android:checked="false"
              /&gt;
  
          &lt;RadioButton
              android:id="@+id/csharp"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:checked="false"/&gt;
          &lt;RadioButton
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/java"
  
              android:checked="false" /&gt;
  
          &lt;Button
              android:id="@+id/btnDisplay"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="NEXT"
              android:onClick="OnClick"
              /&gt;
  
  
  
      &lt;/RadioGroup&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and this class code</p>
  
  <pre><code>package com.example.quiz;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.RadioButton;
  import android.widget.RadioGroup;
  import android.widget.Toast;
  
  /**
   * Created by leste on 3/5/2016.
   */
  public class CS_Category extends Activity {
  
      private RadioGroup radioSexGroup;
      private RadioButton radioSexButton;
      private Button btnDisplay;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.cs_category);
          addListenerOnButton();
      }
  
      public void addListenerOnButton() {
  
          radioSexGroup = (RadioGroup) findViewById(R.id.radioSex);
          btnDisplay = (Button) findViewById(R.id.btnDisplay);
          btnDisplay.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
  
                  // get selected radio button from radioGroup
                  int selectedId = radioSexGroup.getCheckedRadioButtonId();
                  radioSexButton = (RadioButton) findViewById(selectedId);
  
                  if (radioSexButton.getId() == R.id.assembly) {
                      Intent i = new Intent(CS_Category.this, CS_Assembly.class);
                      startActivity(i);
                  } else {
                      if (radioSexButton.getId() == R.id.csharp) {
                          Intent i = new Intent(CS_Category.this, CS_Csharp.class);
                          startActivity(i);
                      } else {
                          if (radioSexButton.getId() == R.id.java) {
                              Intent i = new Intent(CS_Category.this, CS_Java.class);
                              startActivity(i);
  
                          }
  
                      }
  
  
                      Toast.makeText(CS_Category.this,
                              radioSexButton.getText(), Toast.LENGTH_SHORT).show();
  
  
                  }
              }
  
  
          });
  
  
      }
  }
  </code></pre>
  
  <p>What should I do to hide the next button and show only if there is a selected radio button</p>