title: OnClickListener in Android Studio
body: <p>I'm attempting to develop and app using the new Android Studio, but I keep receiving major errors on my OnClickListeners. Mainly it is telling me that it cannot resolve symbol "setOnClickListener" and it also cannot resolve "View v"</p>
  
  <pre><code>package com.sigmachi.derbydays;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      Button button= (Button) findViewById(R.id.standingsButton);
      button.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              startActivity(new Intent(MainActivity.this,StandingsActivity.class));
          }
      });
  </code></pre>
  
  <p>That is the code in the class</p>
  
  <pre><code>Information:Compilation completed with 11 errors and 0 warnings in 4 sec
  Information:11 errors
  Information:0 warnings
  /Users/angelo/AndroidStudioProjects/SigmaChiDerbyDaysProject/SigmaChiDerbyDays/src/main/java/com/sigmachi/derbydays/MainActivity.java
      Error:Error:line (28)Gradle: &lt;identifier&gt; expected
      Error:Error:line (28)Gradle: illegal start of type
      Error:Error:line (28)Gradle: ')' expected
      Error:Error:line (28)Gradle: ';' expected
      Error:Error:line (28)Gradle: invalid method declaration; return type required
      Error:Error:line (30)Gradle: illegal start of type
      Error:Error:line (30)Gradle: ';' expected
      Error:Error:line (30)Gradle: ')' expected
      Error:Error:line (30)Gradle: not a statement
      Error:Error:line (30)Gradle: ';' expected
      Error:Error:line (33)Gradle: illegal start of type
  </code></pre>
  
  <p>Those are the errors I am receiving which makes absolutely no sense. Line 28 starts at when I do <code>button.setOnClickListener</code></p>
  
  <p>EDIT: Now I receive a force close when I press the button</p>
  
  <p>This is the class it should open, a bare class with the only change being the layout to open</p>
  
  <pre><code>package com.sigmachi.derbydays;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  
  public class StandingsActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.standings_layout);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  }
  </code></pre>