Fix deprecated getActionView(MenuItem)

This commit is contained in:
Andrew Rabert 2018-04-24 00:10:09 -04:00
parent 72424659ab
commit 345b717f86
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
void onFinishSetupOptionsMenu(final Menu menu) { void onFinishSetupOptionsMenu(final Menu menu) {
searchItem = menu.findItem(R.id.menu_global_search); searchItem = menu.findItem(R.id.menu_global_search);
if (searchItem != null) { if (searchItem != null) {
searchView = (SearchView) MenuItemCompat.getActionView(searchItem); searchView = (SearchView) searchItem.getActionView();
SearchManager searchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE); SearchManager searchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
SearchableInfo searchableInfo = searchManager.getSearchableInfo(context.getComponentName()); SearchableInfo searchableInfo = searchManager.getSearchableInfo(context.getComponentName());
if (searchableInfo == null) { if (searchableInfo == null) {