title: How can I handle check box using Button in Java?
body: <p>I want to handle checkboxes using a button.
  When I press on Check button I want to write if it's false or true and how can let the user check only 1 checkbox only from the choices?</p>
  
  <pre><code>      package com.example.android.qa;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.text.Html;
  import android.view.View;
  import android.widget.CheckBox;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
      }
  
      public void Question1(View v) {
  
           CheckBox Html = (CheckBox) findViewById(R.id.Html);
           boolean hasHtml = Html.isChecked();
  
           CheckBox Css = (CheckBox) findViewById(R.id.Css);
           boolean hasCss = Css.isChecked();
  
  
           CheckBox JavaScript = (CheckBox) findViewById(R.id.Java_Script);
           boolean hasJavaScript = JavaScript.isChecked();
  
           String Answer1 = Question1Active("True", "False","False");
  
      }
  
      public String Question1Active(String Html, String Css, String JavaScript){
  
          String Answer1 = "\n" + getString(R.string.True) + Html;
          Answer1 = "\n" + getString(R.string.False) + Css;
          Answer1 = "\n" + getString(R.string.False) + JavaScript;
          return Answer1;
      }
  
  }
  </code></pre>