title: Trouble starting new layout after button click
body: <p>I am trying to make a fairly simple calculator app for getting familiar with android. My goal is to load a new interface with trig, logarithmic functions, etc. upon clicking the mode button on the xml layout file. I included activity in the manifest as well but it failed when I ran the project. What can I do so that it works?</p>
  
  <p>Here is the main activity class:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class Calculator extends Activity implements OnClickListener{
  public String str = "";
  Character task = 'q';
  double num, numtemp;
  EditText showResult;
  Button mode;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.display);
      showResult = (EditText) findViewById(R.id.result_id);
      mode = (Button) findViewById(R.id.bMode);
      mode.setOnClickListener(this);
  }
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      if(v.getId() == R.id.bMode)
      {
          Intent i = new Intent("zero.paradox.valvemachine.SWITCHNODE");
          startActivity(i);
      }
  }
  
  public void btn1Clicked(View v) {
      insert(1);
  }
  
  public void btn2Clicked(View v) {
      insert(2);
  }
  
  public void btn3Clicked(View v) {
      insert(3);
  }
  
  public void btn4Clicked(View v) {
      insert(4);
  }
  
  public void btn5Clicked(View v) {
      insert(5);
  }
  
  public void btn6Clicked(View v) {
      insert(6);
  }
  
  public void btn7Clicked(View v) {
      insert(7);
  }
  
  public void btn8Clicked(View v) {
      insert(8);
  }
  
  public void btn9Clicked(View v) {
      insert(9);
  }
  
  public void btn0Clicked(View v){
      insert(0);
  }
  
  public void btnplusClicked(View v) {
      perform();
      task = '+';
  }
  
  public void btnminusClicked(View v) {
      perform();
      task = '-';
  }
  
  public void btndivideClicked(View v) {
      perform();
      task = '/';
  }
  
  public void btnmultiClicked(View v) {
      perform();
      task = '*';
  }
  
  public void btnequalClicked(View v) {
      calculate();
  }
  
  public void btnclearClicked(View v) {
      reset();
  }
  
  private void reset() {
      // TODO Auto-generated method stub
      str = "";
      task = 'q';
      num = 0;
      numtemp = 0;
      showResult.setText("");
  }
  
  private void insert(int j) {
      // TODO Auto-generated method stub
      str = str + Integer.toString(j);
      num = Integer.valueOf(str).intValue();
      showResult.setText(str);
  
  }
  
  private void perform() {
      // TODO Auto-generated method stub
      str = "";
      numtemp = num;
  }
  
  private void calculate() {
      // TODO Auto-generated method stub
      if (task == '+')
          num = numtemp + num;
      else if (task == '-')
          num = numtemp - num;
      else if (task == '/')
          num = numtemp / num;
      else if (task == '*')
          num = numtemp * num;
      showResult.setText("" + num);
      }
  
  }
  </code></pre>
  
  <p>And the code for the new mode:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class SwitchMode extends Activity implements OnClickListener{
  
  Button mode2;
  EditText showResult2;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.display2);
      showResult2 = (EditText) findViewById(R.id.edtNode);
      mode2 = (Button) findViewById(R.id.bMode);
      mode2.setOnClickListener(this);
  }
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      if(v.getId() == R.id.mode)
      {
          Intent i = new Intent("org.calculator.MAINACTIVITY");
          startActivity(i);
      }
  }
  
  }
  </code></pre>
  
  <p>This is not working for me.. is there anything I can do to fix it?</p>