title: How can I compare a string value with string from spinner?
body: <p>I am comparing a string value from selected string value from spinner. However, even if the string that I am testing is the same string value from spinner it always return false. I have tested different ways, simplifying the conditions and it always ends the same. The printed value in the log is the same with the string, so why does it always return false?</p>
  
  <pre><code>final Spinner spinner_familyTest = (Spinner) findViewById(R.id.spinner_family);
      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
          R.array.family_array, R.layout.spinner_layout);
      adapter.setDropDownViewResource(R.layout.spinner_layout);
      spinner_familyTest.setAdapter(adapter);
  
  //  Value of familyTest from spinner as printed in the log is "Apiaceae"
      familyTest = spinner_familyTest.getSelectedItem().toString(); 
  
      if (familyTest == "Apiaceae") {
                      Log.i(TAG, "This is True!");
                      }
                      Log.i(TAG, "This is False");
  </code></pre>