I want to remove focus and text from SearchView
in onResume()
.
I tried searchView.clearFocus()
but it is not working.
Thi
You can manually hide the keyboard in onResume() function as:
InputMethodManager imm = (InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE);
View view = context.getCurrentFocus();
if (view == null) {
view = new View(context);
}
if (view != null) {
IBinder iBinder = view.getWindowToken();
imm.hideSoftInputFromWindow(iBinder, 0);
}