List of usage examples for android.app SearchManager getSearchablesInGlobalSearch
public List<SearchableInfo> getSearchablesInGlobalSearch()
From source file:com.packetsender.android.MainActivity.java
private void setupSearchView(MenuItem searchItem) { //searchItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); if (searchManager != null) { List<SearchableInfo> searchables = searchManager.getSearchablesInGlobalSearch(); SearchableInfo info = searchManager.getSearchableInfo(getComponentName()); for (SearchableInfo inf : searchables) { if (inf.getSuggestAuthority() != null && inf.getSuggestAuthority().startsWith("applications")) { info = inf;/* w w w.j a v a2s. c o m*/ } } mSearchView.setSearchableInfo(info); } mSearchView.setOnQueryTextListener(this); }