title: trying to fix a button/ view controller in java
body: <p>I'm having issues with my view controller in my android application. I'll admit I'm a noob at android programing please forgive me here is my issue and photos of the application. Basically i just what to press the button and go to the related page and i can't quite figure it out.</p>
  
  <p><a href="http://imgur.com/aVpqUCZ" rel="nofollow">http://imgur.com/aVpqUCZ</a></p>
  
  <pre><code>package com.Apps.jarredapp;
  
  public class ViewController extends Activity implements View.OnClickListener {
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
  
          setContentView(R.layout.my_layout);
  
          Button btnSearchStudent = (Button) findViewById(R.id.button1);
          Button btnNewStudent = (Button) findViewById(R.id.button2);
          Button btnLegalInfo = (Button) findViewById(R.id.button3);
  
          btnSearchStudent.setOnClickListener(this);
          btnNewStudent.setOnClickListener(this);
          btnLegalInfo.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.button1: {
                  Intent intent = new Intent(this, SearchStudentActivity.class);
                  startActivity(intent);
                  break;
              }
              case R.id.button2: {
                  Intent intent = new Intent(this, NewStudentActivity.class);
                  startActivity(intent);
                  break;
              }
              case R.id.button3: {
                  Intent intent = new Intent(this, LegalInfoActivity.class);
                  startActivity(intent);
                  break;
              }
          }
      }
  
      {
  
  
  Button searchStudentButton;
  Button newStudentButton;
  Button legalButton;
  
  searchStudentButton = (Button) findViewById(R.id.button1);
  
  searchStudentButton.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
      Intent myIntent = new Intent(CurrentActivity.this, searchStudentActivity.class);
      CurrentActivity.this.startActivity(myIntent);
      }
  });
  
  newStudentButton = (Button) findViewById(R.id.button2);
  
  newStudentButton.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
      Intent myIntent = new Intent(CurrentActivity.this, newStudentActivity.class);
      CurrentActivity.this.startActivity(myIntent);
      }
  });
  
  legalButton = (Button) findViewById(R.id.button3);
  
  legalButton.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
      Intent myIntent = new Intent(CurrentActivity.this, legalActivity.class);
      CurrentActivity.this.startActivity(myIntent);
      }
  });
  </code></pre>