How to validate data being entered into an EditText control?

by Videoguy » Tue, 14 Apr 2009 02:05:17 GMT


Sponsored Links
 Hi
I have an EditText control to accept IP address fields. Its xml input
attribute allows everything else except IP addresses.
How to make the control accept dotted IP quad addresses only?

Thanks
Videoguy
--~--~---------~--~----~------------~-------~--~----~



How to validate data being entered into an EditText control?

by MrChaz » Tue, 14 Apr 2009 02:49:24 GMT


 Could you could create your own KeyListener and pass it into the
TextView via setKeyListener()?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to validate data being entered into an EditText control?

by Videoguy » Tue, 14 Apr 2009 03:00:06 GMT


 That is what I thought initially. But Editable has all types of
InputFilters you can register to validate/constrain input being
entered.
I didn't find any filter so far that can validate IP quads.
I will write one probably.

Thanks
Videoguy
--~--~---------~--~----~------------~-------~--~----~