So this I the code I use in the Activity that should get a search function:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
// Associate searchable configuration with the SearchView
SearchManager searchManager =
(SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView =
(SearchView) menu.findItem(R.id.search).getActionView();
***searchView.setSearchableInfo(
searchManager.getSearchableInfo(getComponentName()));***
return true;
}
I got this code from the androidDeveloper site. The two lines that I made highlighted are the ones that are making trouble. What am I doing wrong?