title: How to implement search widget in Action Bar Sherlock?
body: <p>I tried to get Search box to work on Action Bar Sherlock.</p>
  
  <p>This is my <code>PreLocationActivity</code>:</p>
  
  <pre><code>    @ContentView(R.layout.search)
      public class PreLocationActivity extends RoboSherlockActivity {
  
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              //setContentView(R.layout.map_layout);
          } 
  
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              //Used to put dark icons on light action bar
               menu.add("Search")
               .setIcon(R.drawable.ic_search_inverse)
               .setActionView(R.layout.collapsible_edittext)
               .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
                  return true;
          }
  
          @Override
          public boolean onSearchRequested() {
              return super.onSearchRequested();
          }
      }
  </code></pre>
  
  <p>This is my <code>SearchableActivity</code>:</p>
  
  <pre><code>@ContentView(R.layout.search)
  public class SearchableActivity extends RoboSherlockFragmentActivity {
  
      @InjectView(R.id.addressListView) ListView addressView;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          // Get the intent, verify the action and get the query
          Intent intent = getIntent();
          if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
            String query = intent.getStringExtra(SearchManager.QUERY);
            doGeoSearch(query);
          }
  }
  
      public void doGeoSearch(String query){
          Geocoder geocoder;
          ArrayList&lt;Address&gt; addresses;
          ArrayList&lt;String&gt; address = new ArrayList&lt;String&gt;() ;
          geocoder = new Geocoder(this, Locale.getDefault());
          try {
              addresses = (ArrayList&lt;Address&gt;) geocoder.getFromLocationName(query, 6);
              Log.d("Address",String.valueOf(addresses));
              for(int i = 0;i&lt;addresses.size();i++)
              {
              String addr = new String();
              addr.concat(addresses.get(i).getAddressLine(0));
              addr.concat(addresses.get(i).getAddressLine(1));
              addr = addresses.get(i).getAddressLine(0) + addresses.get(i).getLocality() + addresses.get(i).getAdminArea();
              //addr.concat(addresses.get(i).getAddressLine(2));
              Log.d("addr",addr);
              address.add(addr);
  
              }
  
              SearchAddressAdapater addressList = new SearchAddressAdapater(getApplicationContext(),R.layout.search_list,addresses, SearchableActivity.this);
              addressView.setAdapter(addressList);
              //ListView addressListView = new ListView();
          } catch (IOException e) {
                  //Handle exception
          }
      }
  </code></pre>
  
  <p>No success at all. As in, when I type something on the Prelocation Activity and press enter, nothing is being searched. Do I have to treat it as an <code>EditText</code> and write a text listener for that which then calls the <code>geoCoder</code> and gets me the locations or is there a smarter way to go about it? </p>