Prevent crash

Refs #291
This commit is contained in:
M66B 2016-02-16 07:21:14 +01:00
parent 902a0de9a0
commit fbd758140b
1 changed files with 9 additions and 7 deletions

View File

@ -512,13 +512,15 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
if (adapter != null) {
adapter.set(result);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuSearch);
if (search == null) {
if (menuSearch != null && menuSearch.isActionViewExpanded())
adapter.getFilter().filter(searchView.getQuery().toString());
} else {
MenuItemCompat.expandActionView(menuSearch);
searchView.setQuery(search, true);
if (menuSearch != null) {
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuSearch);
if (search == null) {
if (menuSearch.isActionViewExpanded())
adapter.getFilter().filter(searchView.getQuery().toString());
} else {
MenuItemCompat.expandActionView(menuSearch);
searchView.setQuery(search, true);
}
}
}