I want to clear the focus of the edittext when the user clicks on the back button.
This is my onResume method :-
public void onResume() {
super.onResume();
getView().setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if (i == keyEvent.KEYCODE_BACK) {
mEdtDob.clearFocus();
return true;
}
return false;
}
});
}
I want to do that when i click on the back button the focus of the edittext should not be changed.