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. Device Seeding Program for Top ADC2 Developers

Did anyone else get this?  I'm assuming this isn't a phishing attempt
since I don't have to fill out anything.

I think this is a great indication of the seriousness of the Device
Seeding Program.  They're not done giving out phones after the
Developer Labs and the Market Developer giveaway.

-seni

-------
Congratulations! You are one of the top 200 developers in round 1 of
the
Android Developer Challenge 2. To celebrate your success and encourage
you
to create more awesome Android apps, we would like to present you with
a
brand new Android device as part of our developer device seeding
program.

You will receive either a Verizon Droid by Motorola or a Nexus One.
Developers with mailing addresses in the US will receive either a
Droid or
Nexus One, based on random distribution. Developers from Canada, EU,
and
the EEA states (Norway, Lichtenstein), Switzerland, Hong Kong, Taiwan,
and
Singapore will receive a Nexus One. Developers with mailing addresses
in
countries not listed above will not receive a phone since these phones
are
not certified to be used in other countries.
-------------

-- 

2. RelativeLayout's alignParentBottom broken under ScrollView?

If I put a "fill_parent" RelativeLayout beneath a ScrollView, I can
not get an ImageView to align to the parent's bottom.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
            <ImageView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:src=.... />
    </RelativeLayout>
</ScrollView>

As a bit of basic sanity, I have verified that the ImageView will
align to the parent's bottom if I do either of the following.

1) Change "ScrollView" to "HorizontalScrollView"
2) Delete the ScrollView leaving only the RelativeLayout

This is very trivial. Why is it not working?

-- 

3. Miring di fab cafe GI dg forsel

4. Help: spica gw blank di charge ga respon padahal dr td standby dan kemaren abis upgrade firmware

5. Gak bisa preview

6. Programmatically check whether Market app shows copy-protected apps

7. ServerSocket 3G connection