title: How to search in android spinner dropdown
body: <p>I have a spinner dropdown in android and it is populated with list of names as text and ID as value. Now the issue is I have a textbox where user inputs string and on button click item with the name like textbox string should get automatically selected. I searched on google , but couldn't find anything useful. I used </p>
  
  <pre><code> drpMaterial.setSelection(p);
  </code></pre>
  
  <p>but it works on index, I was looking for something which will work on  text not the value in spinnner dropdown.</p>
  
  <p>My code for populating spinner dropdown:</p>
  
  <pre><code> Itm=new CItem( "-1", "Select Material" );
                  lstItm.add(Itm);
                  for(int i=0; i &lt; lengthJsonArr; i++) {
  
                      jsonmain = j.getJSONObject(i);
  
                      Itm=new CItem(jsonmain.getString("ID"),jsonmain.getString("Text"));
                      lstItm.add(Itm);
  
  
                  }
   if(lstItm.size()&gt;0) {
               ArrayAdapter&lt;CItem&gt; adapterProj = new ArrayAdapter&lt;CItem&gt;(myactivity, android.R.layout.simple_spinner_item, lstItm);
  
               drpProj.setAdapter(adapterProj);
           }
  </code></pre>