Android Question Numeric keypad!

Beja

Expert
Licensed User
Longtime User
Hi All,
searching the forum, I didn't find a keypad example project, where a numeric (from 0 to 9 + decimal point) will pop up when
an edittext box got the focus.
if there exists a small project just to demonstrate that please point me to it.. or I will shuffle through the many code snippets available on the forum.

thanks in advance.
 

Eumel

Active Member
Licensed User
Longtime User
Hi,

You must set the Input type flag.

B4X:
Dim Edittext1 as Edittext

Edittext1.InputType = Edittext1.INPUT_TYPE_NUMBERS
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Eumel,

Thanks for the quick response.. it is working fine now.. the only problem I can't input the decimal point
because it is somehow disabled.. it shows on the pop-up keypad window but not active..
Any suggestions?
Thanks in advance.
 
Upvote 0

Eumel

Active Member
Licensed User
Longtime User
Change the Input type flag to

B4X:
Edittext1.InputType = Edittext1.INPUT_TYPE_DECIMAL_NUMBERS
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks Eumel.. that was great help.. it is now working perfectly.
 
Upvote 0

Todd Carlton

Member
Licensed User
Longtime User
If you're using the Designer, you can also set the "Input Type" attribute to DECIMAL_NUMBERS in the designer and not ever have to deal with it in the code.

-OCS
 
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
Just remember that using this "Input Type" attribute, its only a suggestion to the current IME.

So, the behavior will be different across multiple devices with multiple IMEs.
 
Upvote 0
Top