title: Calculator shows number with operator on one edittext - Android
body: <p>So I have a simple calculator, it works but it doesn't show the full equation (like numbers with operators) on the edittext. What I want to do now is to show the full equation in the edittext. For example, I want to show 8 + 8 , then when I click the = sign, that's when the results change to 16. I just want to show the whole equation. How can I do that with my code? Can someone help me.</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  public String str ="";
   Character op = 'q';
   int i,num,numtemp;
      EditText showResult;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
  
          showResult = (EditText)findViewById(R.id.result_id);
  
  
      }
        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();
         op = '+';
  
        }
  
   public void btnminusClicked(View v){
      perform();
           op = '-';
  
        }
        public void btndivideClicked(View v){
         perform();
         op = '/';
  
        }
        public void btnmultiClicked(View v){
         perform();
         op = '*';
  
        }
        public void btnequalClicked(View v){
         calculate();
  
        }
  
   public void btnclearClicked(View v){
         reset();
        }
  
   private void reset() {
    // TODO Auto-generated method stub
     str ="";
     op ='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(op == '+')
       num = numtemp+num;
      else if(op == '-')
       num = numtemp-num;
      else if(op == '/')
       num = numtemp/num;
      else if(op == '*')
       num = numtemp*num;
      showResult.setText(""+num);
     }
  
  }
  </code></pre>