title: Cannot invoke toString() on the primitive type double
body: <blockquote>
    <p>textdisplay.setText(total.toString());</p>
  </blockquote>
  
  <p>When i am trying to revoke String. It gives me error like "Cannot invoke tostring() on the primitive type double". I read similar thread and tried everything but nothing works. Strange part is that this same code works for my friend.
  Please help.</p>
  
  <pre><code>public void showsign(String sign){
          if(last_button==R.id.plus || last_button==R.id.minus || last_button==R.id.multiply 
              || last_button==R.id.divide){
  
      }
      else{
          clear_flag = 1;
          Double newNumber = Double.parseDouble(textdisplay.getText().toString());
          if(sign_flag == "" || sign_flag == "="){
              total = newNumber;
              textdisplay.setText(total.toString());
  
          }
          else if(sign_flag == "+"){
              total = total+newNumber;
              textdisplay.setText(total.toString());
          }
          else if(sign_flag == "-"){
              total = total-newNumber;
              textdisplay.setText(total.tostring());
          }
          else if(sign_flag == "*"){
              total = total*newNumber;
              textdisplay.setText(total.tostring());
          }
          else if(sign_flag == "/"){
              total = total/newNumber;
              textdisplay.setText(total.tostring());  
          }
  
  
      }
  } 
  </code></pre>