Android: How can I validate EditText input?

Posted by Stefan on Stack Overflow See other posts from Stack Overflow or by Stefan
Published on 2010-05-04T05:35:11Z Indexed on 2010/05/04 5:38 UTC
Read the original article Hit count: 924

Filed under:
|
|

I need to do form validation on a series of EditTexts. I'm using OnFocusChangeListeners to trigger the validation, but this doesn't behave as desired for the final EditText.

If I click on the "Done" button while typing into the final EditText then the InputMethod is disconnected, but technically focus is never lost on the EditText (and so validation never occurs).

What's the best solution?

Should I be monitoring when the InputMethod unbinds from each EditText rather than when focus changes? If so, how?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk