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
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Jabber / XMPP Room for Android Developers Group

Hi all, fellow Android developers, i suggest we have Jabber / XMMP
room for live discussion about Android. According to Jabber / XMMP it
self was being developed for that purposes, advancing forum technique
from passive to active discussion. Thank you and fellow developers and
group admins might consider this.

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

2. Custom LayoutParams?

Hi,

I have created a custom ViewGroup and would like to have a custom
LayoutParams together with it so I can assign these to the children
through the XML.

I have created a custom LayoutParams class and added the following to
my attrs.xml:
<declare-styleable name="LayoutParams">
        <attr name="column_span" format="integer" />
        <attr name="row_span" format="integer" />
</declare-styleable>

I can use the xml tags in my children from my layout.xml with:
                app:column_span="2"
                app:row_span="2"

But I do not understand how the inflate process should be able to
understand that it should create my type of LayoutParams (it doesn't
at the moment). If I only had my own type of children I could override
the inflate process, but that can't be the preferred way?

Any ideas how I correctly should create my own ViewGroup with
associated LayoutParams that can be used from xml?
--~--~---------~--~----~------------~-------~--~----~

3. long click on MapView

4. XSLT on Android

5. duplicate entry: classes.dex

6. Problem with bindService

7. maximum version of adb