EditText android:numeric attribute in Java

by Aldo Culquicondor » Wed, 22 Dec 2010 06:47:33 GMT


Sponsored Links
 Hi everybody:
I need to create EditText views dynamically, so i can't use XML, i
have to use Java.
The problem is that this EditText might worked just with numbers
(float), I mean, in XML it should have set the android:numeric
attribute like this:
android:numeric="integer|signed|decimal"
How do i do the same in java?

I think this is related with the setKeyListener() method, but i don't
know what to put as argument.

Thanks a lot...

-- 



Re: EditText android:numeric attribute in Java

by TreKing » Wed, 22 Dec 2010 12:46:12 GMT


 




Try:
 http://developer.android.com/reference/android/widget/TextView.html #setRawInputType(int)

 http://developer.android.com/reference/android/text/InputType.html #TYPE_CLASS_NUMBER
< http://developer.android.com/reference/android/text/InputType.html #TYPE_CLASS_NUMBER>
 http://developer.android.com/reference/android/text/InputType.html #TYPE_NUMBER_FLAG_SIGNED
< http://developer.android.com/reference/android/text/InputType.html #TYPE_NUMBER_FLAG_SIGNED>
 http://developer.android.com/reference/android/text/InputType.html #TYPE_NUMBER_FLAG_DECIMAL

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. API to test if an application has the Auto Update flag enabled?

I'd like to get a list of my applications that have the auto update flag 
enabled.  After searching the APIs and lots of googling, i can't seem to 
find an API that would allow me to test if an Application has this set or 
not.  Does anyone know how to check for this behaviour?

Thanks.

-- 

2. Resigned app not listed under Apps

Hello,

I have to control Settings.apk file through Robotium tool. So, I tried
to resign the app using a drag and drop tool for resigning from
http://www.troido.de/re-sign.jar . After resigning is done, my
application is saved as Settings_Debug.apk. When I try to push this
file to my android device at  /system/app, it says copied successfully
but not listed in the Apps/My Apps.

Any suggestions will be highly appreciated.

Thanks,
Rakesh

-- 
.

3. [ask] android httpclient login into web and request data

4. Android version doubts

5. Fake Multitouch : was --禄 WTA: CSL Blueberry MI 410

6. [WTA-renew] Optimus2X internal storage & usb tethering problem

7. [WTA] Optimus2X internal storage dan usb tether problem di XP