title: Android: Button onclick showing error
body: <p>For my two buttons I want to implement a switch case and with on click I am getting the following errors how to solve this?</p>
  
  <blockquote>
    <p>void is an invalid type for the
    variable onClick 
               Syntax error on token ")", ; expected</p>
  </blockquote>
  
  <p>Here is my code.</p>
  
  <pre><code>        Button regmalebtn = (Button) findViewById(R.id.regmalebtn);
          Button regfemalebtn = (Button) findViewById(R.id.regfemalebtn);
  
      String gender; 
      gender = regmalebtn.getText().toString();
    public void onClick(View v) {
  
        switch(v.getId()){
  
        case R.id.regmalebtn:
      //    String gender; 
      //    gender = regmalebtn.getText().toString();
          gender.equals("M");
      //  request.addProperty("gender",gender );
  
             break;
  
        case R.id.regfemalebtn:
            gender = regfemalebtn.getText().toString();
              gender.equals("F");
              //request.addProperty("gender", gender);
             break;
             default:
                 break;
        }
    }  
  </code></pre>