title: Need help in my program in eclipse
body: <pre><code>public void click(View view) {
  
      String one = "one";
      EditText et = (EditText)findViewById(R.id.editText1);
      String entered_text = et.getText().toString();
  
      if(et.getText().toString() == one){
  
          TextView tv1 = (TextView)findViewById(R.id.textView1);
          tv1.setText("Correct!");
      }
  
      else {
  
          TextView tv = (TextView)findViewById(R.id.textView1);
          tv.setText(one+entered_text);   }
      }
  </code></pre>
  
  <p>This is a code snippet extracted from my program, I didn't post the whole program because it wasn't necessary, as the program runs fine without any runtime exceptions.</p>
  
  <p>So, the program when executed on Eclipse doesn't show any errors and runs fine, but when run the, <code>if</code> condition <code>et.getText().toString() == "one"</code> always returns false even when the <code>entered_text</code> is <code>one</code> i.e.; it never prints "correct!" and the code always prints "one+entered_text" that is the statement in the else clause. And the interesting point is, if you enter <code>one</code> the output will be <code>oneone</code>, that is the else statement. </p>
  
  <p>Please help me where I went wrong. 
  Thanks in advance.</p>