title: ArrayAdapter.getPosition is not finding my object
body: <p>New to Android, I got a simple application with spinners and associated ArrayAdapters working: when things get selected, I seem to be able and trigger some calculations. I am then saving the current selected item.</p>
  
  <p>At some point, I retrieve the saved value, and want to position the spinner at that value: basically setPosition() the spinner to that object.</p>
  
  <p>I have found lots of tutorials with the same format I have: use the getPosition() on the ArrayAdapter, and pass in the object you are looking for... Trouble is, it keeps returning -1 (not found).</p>
  
  <p>Debugging, I have verified that the object I pass is not null, and so is the ArrayAdapter, and also the ArrayAdapter getCount returns me the items it should have (so it's not empty).</p>
  
  <p>I'm at loss. Appreciate any... pointers? :-)</p>
  
  <p>/* ArrayAdapter class looks like this*/</p>
  
  <pre><code>public class MyAdapter extends ArrayAdapter&lt;MyClass&gt; {
      // Constructor
      MyAdapter(@NonNull Context context, int resource, @NonNull List&lt;MyClass&gt; objects) {
          super(context, resource, objects);
      }
  }
  </code></pre>
  
  <p>/* Fragment looks like this*/</p>
  
  <pre><code>final MyAdapter mAdapter = new MyAdapter(
                                   requireActivity(), 
                                   android.R.layout.simple_spinner_item, 
                                   objects);
  Spinner mySpinner = fragment_view.findViewById(R.id.my_spinner);
  mySpinner.setAdapter(mAdapter);
  
  // assume I have one "object" of MyClass,
  // and want to search for it in "MyAdapter"
  
  int spinnerPosition = mAdapter.getPosition(objectToBeFound);  // returns -1
  mySpinner.setSelection(spinnerPosition);
  </code></pre>