title: Comparing two strings in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/767372/java-string-equals-versus">Java String.equals versus ==</a>  </p>
  </blockquote>
  
  
  
  <p>I know it' a dumb question but why this code doesn't work.       </p>
  
  <pre><code>boolean correct = "SampleText"  == ((EditText)findViewById(R.id.editText1)).getText().toString();
      if(correct) ((TextView)findViewById(R.id.textView1)).setText("correct!");
      else ((TextView)findViewById(R.id.textView1)).setText("uncorrect!");  
  </code></pre>
  
  <p>The point is to check if content of "editText1" is equal to "Sample Text"</p>