title: calculator with one input edittext android
body: <p>i am a beginner in android. i am trying to make a calculator with just one input edit text.
  when i click + button it doesn't give a sum output. to get a correct ans i have to click the +button after both the entries. like to get a sum i will do it as 1"+" 1"+""=. then it would give 2. here's my code,someoneplease help me.</p>
  
  <pre><code>public void onClick(View v){
      double sum=0; 
      switch(v.getId()){
      case R.id.buttonplus:
          sum += Double.parseDouble(String.valueOf(textView.getText()));
          numberDisplayed.delete(0,numberDisplayed.length());
          break;
      case R.id.buttonequal:
          resultView.setText(String.valueOf(sum));
          sum=0;
      }
  </code></pre>