title: How to handle multiple spinner selected item comparison?
body: <p>I am trying to get my app to display either a text or an image when two spinners selected values equal each other.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Spinner sp1 =(Spinner)findViewById(R.id.sp1);
          String txtFromSpinner1 = sp1.getSelectedItem().toString();
  
          Spinner sp2 = (Spinner)findViewById(R.id.sp2);
          String txtFromSpinner2 = sp2.getSelectedItem().toString();
  
          if (txtFromSpinner1.equals(1)&amp;&amp; txtFromSpinner2.equals(2)){
  
              TextView textElement = (TextView)findViewById(R.id.txResult);
              textElement.setText("3");
  
          }
      }
  }
  </code></pre>