I am facing the issue of back key or del key which is not working in 4.4 and 5.0.1 devices ? When I press the back key of softkeyboard below method is not calling.
Username.setOnKeyListener(controller);
Password.setOnKeyListener(controller);
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(event.getAction() == KeyEvent.KEYCODE_DEL){
getActivity().setDisableLoginButton();
}
return false;
}
Anyone suggest me what should I do ? I am disabling the button if there's no input in username & password. Please, suggest me also suggest me other solutions if you have.
As i found here https://developer.android.com/training/keyboard-input/commands.html
So you should use
TextWatcher
for edit text and get available char and deleted char.}