Merge pull request #392 from honnel/cursor-reset2

Reset cursor query when closing search view #386
This commit is contained in:
Dominik Schürmann 2014-03-11 00:15:22 +01:00
commit 7fc80be660

View File

@ -367,6 +367,20 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer
// Execute this when searching
mSearchView.setOnQueryTextListener(this);
//Erase search result without focus
MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
mCurQuery = null;
getLoaderManager().restartLoader(0, null, KeyListPublicFragment.this);
return true;
}
});
super.onCreateOptionsMenu(menu, inflater);
}