title: Simple android calculator application crashes
body: <p>I am building a simple calculator, but for some reason, it crashes as soon as I press a button. Please help me out with it.</p>
  
  <p>This is my Calculator.java class.</p>
  
  <pre><code>package com.dexter.seemab;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.EditText;
  
  public class Calculator extends Activity{   
  String display="";
   Character op = 'q';
   int i,num,numtemp;
   int check=0;
   EditText rd;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.calculator);
      rd=(EditText)findViewById(R.id.etResult);
  
  
  }
  public void btnClicked(View v){
      switch(v.getId()){
      case R.id.one:{
          insert(1);
      }
      case R.id.two:{
          insert(2);
      }
      case R.id.three:{
          insert(3);
      }
      case R.id.four:{
          insert(4);
      }
      case R.id.five:{
          insert(5);
      }
      case R.id.six:{
          insert(6);
      }
      case R.id.seven:{
          insert(7);
      }
      case R.id.eight:{
          insert(8);
      }
      case R.id.nine:{
          insert(9);
      }
      case R.id.zero:{
          insert(0);
      }
      case R.id.add:{
          perform();
          op='+';
      }
      case R.id.sub:{
          perform();
          op='-';
      }
      case R.id.product:{
          perform();
          op='*';
      }
      case R.id.difference:{
          perform();
          op='/';
      }
      case R.id.equals:{
          calculate();
      }
      case R.id.clear:{
          clear();
      }
      }
  }
  public void insert(int digit){
      if (check==1){
          clear();}
      display=display+Integer.toString(digit);
      num=Integer.valueOf(display).intValue();
      rd.setText(display);
      check=0;
  }
  public void perform(){
      numtemp=num;
      display=display+op.toString();
  }
  public void calculate(){
      switch(op){
      case '+':
          i=num+numtemp;
      case '-':
          i=num-numtemp;
      case '*':
          i=num*numtemp;
      case '/':
          i=num/numtemp;
      }
      display=Integer.toString(i);
      rd.setText("="+display);
      check=1;
  }
  public void clear(){
      op='q';
      num=0;
      numtemp=0;
      i=0;
      display="";
      rd.setText(display);
  }
  
  }
  </code></pre>
  
  <p>my buttons contain an onClick listener which points to the method btnClicked(). Now whenever I press a button, the program of mine crashes. PLease help me out with it. Thanks.</p>