I want an EditText to always have focus no matter what so I subclassed EditText and added this:
setFocusable(true);
setFocusableInTouchMode(true);
setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus) {
requestFocus();
}
}
});
But the code does not work. Any clue why?