title: How to change text of items in a searchable spinner
body: <p>i am trying to create a searchable spinner and attach an array adapter to it. the content of the spinner should be an object (i did this so i can retrieve the id and display the name). I'm almost done but instead of the names getting displayed, I get this:
  <a href="https://i.stack.imgur.com/Ev6tg.png" rel="nofollow noreferrer">searchable spinner</a></p>
  
  <p>here's my code:</p>
  
  <pre><code>public class CitySpinnerAdapter extends ArrayAdapter&lt;City&gt; {
  
  private Context context;
  private ArrayList&lt;City&gt; myObjs;
  
  public CitySpinnerAdapter(Context context, int textViewResourceId,
                                ArrayList&lt;City&gt; myObjs) {
      super(context, textViewResourceId, myObjs);
      this.context = context;
      this.myObjs = myObjs;
  }
  
  public int getCount(){
      return myObjs.size();
  }
  
  public City getItem(int position){
      return myObjs.get(position);
  }
  
  public long getItemId(int position){
      return position;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      TextView label = new TextView(context);
      label.setText(myObjs.get(position).getName());
      return label;
  }
  
  @Override
  public View getDropDownView(int position, View convertView,
                              ViewGroup parent) {
      TextView label = new TextView(context);
      label.setText(myObjs.get(position).getName());
      return label;
  }}
  </code></pre>
  
  <p>and here's how i created my spinner:</p>
  
  <pre><code>city2Spinner = (SearchableSpinner) findViewById(R.id.city2);
  
      CityDBHelper citydb = new CityDBHelper(getApplicationContext());
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; cities2 = citydb.getCities();
  
      cities2Obj = new ArrayList&lt;City&gt;();
      for(HashMap&lt;String, String&gt; city2 : cities2){
          //for(String key : province.keySet()){
          //String name = province.get(key);
          cities2Obj.add(new City(Integer.valueOf(city2.get("id")), Integer.valueOf(city2.get("orig_id")), city2.get("name"), Integer.valueOf(city2.get("pid"))));
          //}
      }
  
      CitySpinnerAdapter city2Adapter =
              new CitySpinnerAdapter(AddProspectActivity.this,
                      android.R.layout.simple_spinner_item, cities2Obj);
      //adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      city2Spinner.setTitle("Select City");
      city2Spinner.setPositiveButton("OK");
  
  
      city2Spinner.setAdapter(city2Adapter);
  </code></pre>
  
  <p>i'm really confused as to where i should change the items. please help. i hope i was clear. :( (i am using com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1)</p>