title: Do I need to create these many classes for this android app?
body: <p>I am an absolute beginner at programming so I just want to make sure I am doing this right or if there is an easier way. basically the app I am creating is a school app that will list all courses needed for different majors.</p>
  
  <p>So opening screen has two buttons undergrad and grad. The next screen would list all majors for either grad or undergrad, which ever one the user chose, then say a person clicked accounting it would then list all courses for accounting major. My question is do I need to create a seperate class for each course and major?? Below is the code I have been doing.</p>
  
  <pre><code>       package Class.Review;
  
  import Class.Review.R;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  import android.content.Intent;
  
  public class ClassReviewActivity extends Activity {
  /** Called when the activity is first created. */
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      Button Undergrad = (Button) findViewById(R.id.BUNGrad);
      Undergrad.setOnClickListener(new View.OnClickListener() {
  
          public void onClick(View view) {
              // TODO Auto-generated method stub
              Intent myIntent = 
                      new Intent(view.getContext(),        undergrad.class);
              startActivityForResult(myIntent, 0);
          }
      });
  }
  } 
  </code></pre>
  
  <p><strong>Then say the user clicked undergrad i created another class</strong></p>
  
  <pre><code>     package Class.Review;
  
  import Class.Review.R;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.ScrollView;
  import android.widget.TextView;
  import android.content.Intent;
  
  
  public class undergrad extends Activity  {
  /** Called when the activity is first created. */
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.undergrad);
  
  
  setOnClickListener(new View.OnClickListener() {
  
  public void onClick(View view) {
      // TODO Auto-generated method stub
  
      Intent replyIntent = new Intent();
      setResult(RESULT_OK, replyIntent);
      finish();
  }
  });
  }
  
  private void setOnClickListener(OnClickListener onClickListener) {
      // TODO Auto-generated method stub
  
  
  
  
  Button Accounting = (Button) findViewById(R.id.Accounting);
  Accounting.setOnClickListener(new View.OnClickListener() {
  
  public void onClick(View view) {
      // TODO Auto-generated method stub
      Intent myIntent = 
              new Intent(view.getContext(), accounting.class);
      startActivityForResult(myIntent, 0);
  }
   });
  }
  }  
  </code></pre>
  
  <p><strong>Then choice a specific course within Accounting</strong></p>
  
  <pre><code>    package Class.Review;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.content.Intent;
  
  public class accReview extends Activity{
  /** Called when the activity is first created. */
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.accreview);
  
      setOnClickListener(new View.OnClickListener() {
  
          public void onClick(View view) {
              // TODO Auto-generated method stub
  
              Intent replyIntent = new Intent();
              setResult(RESULT_OK, replyIntent);
              finish();
          }
      });
  
  }
  
  private void setOnClickListener(OnClickListener onClickListener) {
  // TODO Auto-generated method stub
  
  Button review = (Button) findViewById(R.id.reviews);
  review.setOnClickListener(new View.OnClickListener() {
  
      public void onClick(View view) {
          // TODO Auto-generated method stub
          Intent myIntent = 
                  new Intent(view.getContext(), fundReview.class);
          startActivityForResult(myIntent, 0);
      }
  });
  }
  
  }
  </code></pre>