End search on detach body

pull/199/head
M66B 4 years ago
parent b63f5de879
commit a275e930da

@ -5850,6 +5850,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private void startSearch(TextView view) { private void startSearch(TextView view) {
searchView = view; searchView = view;
searchView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View v) {
// Do nothing
}
@Override
public void onViewDetachedFromWindow(View v) {
v.removeOnAttachStateChangeListener(this);
endSearch();
}
});
etSearch.setText(null); etSearch.setText(null);
etSearch.setVisibility(View.VISIBLE); etSearch.setVisibility(View.VISIBLE);
etSearch.requestFocus(); etSearch.requestFocus();

Loading…
Cancel
Save