mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-15 21:35:05 -05:00
Reset cursor query when closing search view #386
Without focus the search result get erased.
This commit is contained in:
parent
da83c8ff60
commit
6fab8a126a
@ -367,6 +367,16 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer
|
|||||||
// Execute this when searching
|
// Execute this when searching
|
||||||
mSearchView.setOnQueryTextListener(this);
|
mSearchView.setOnQueryTextListener(this);
|
||||||
|
|
||||||
|
//Erase search result without focus
|
||||||
|
mSearchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
if (!hasFocus) {
|
||||||
|
mCurQuery = null;
|
||||||
|
getLoaderManager().restartLoader(0, null, KeyListPublicFragment.this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user