Source:
public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_SORT, MENU_SORT, Localization.get("select.menu.sort")).setIcon( android.R.drawable.ic_menu_sort_alphabetically); if (mMappingEnabled) { menu.add(0, MENU_MAP, MENU_MAP, Localization.get("select.menu.map")).setIcon( android.R.drawable.ic_menu_mapmode); } tryToAddActionSearchBar(this, menu, new ActionBarInstantiator() { @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onActionBarFound(MenuItem searchItem, SearchView searchView, MenuItem barcodeItem) { EntitySelectActivity.this.searchItem = searchItem; EntitySelectActivity.this.searchView = searchView; EntitySelectActivity.this.barcodeItem = barcodeItem; if (lastQueryString != null && lastQueryString.length() > 0) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { searchItem.expandActionView(); } searchView.setQuery(lastQueryString, false); if (adapter != null) { adapter.applyFilter(lastQueryString == null ? "" : lastQueryString); } } EntitySelectActivity.this.searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return true; } @Override public boolean onQueryTextChange(String newText) { lastQueryString = newText; filterString = newText; if (adapter != null) { adapter.applyFilter(newText); } return false; } }); } }); if (shortSelect != null) { Action action = shortSelect.getCustomAction(); if (action != null) { ViewUtil.addDisplayToMenu(this, menu, MENU_ACTION, action.getDisplay().evaluate()); } makeCalloutClickListener(shortSelect.getCallout()); setupImageLayout(barcodeItem, shortSelect.getCallout().getImage()); } return true; }

Target:
public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_SORT, MENU_SORT, Localization.get("select.menu.sort")).setIcon( android.R.drawable.ic_menu_sort_alphabetically); if (mMappingEnabled) { menu.add(0, MENU_MAP, MENU_MAP, Localization.get("select.menu.map")).setIcon( android.R.drawable.ic_menu_mapmode); } tryToAddActionSearchBar(this, menu, new ActionBarInstantiator() { @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onActionBarFound(MenuItem searchItem, SearchView searchView, MenuItem barcodeItem) { EntitySelectActivity.this.searchItem = searchItem; EntitySelectActivity.this.searchView = searchView; EntitySelectActivity.this.barcodeItem = barcodeItem; if (lastQueryString != null && lastQueryString.length() > 0) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { searchItem.expandActionView(); } searchView.setQuery(lastQueryString, false); if (adapter != null) { adapter.applyFilter(lastQueryString == null ? "" : lastQueryString); } } EntitySelectActivity.this.searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return true; } @Override public boolean onQueryTextChange(String newText) { lastQueryString = newText; filterString = newText; if (adapter != null) { adapter.applyFilter(newText); } return false; } }); } }); if (shortSelect != null) { Action action = shortSelect.getCustomAction(); if (action != null) { ViewUtil.addDisplayToMenu(this, menu, MENU_ACTION, action.getDisplay().evaluate()); } if(shortSelect.getCallout() != null && shortSelect.getCallout().getImage() != null){ setupImageLayout(barcodeItem, shortSelect.getCallout().getImage()); } } return true; }