Masked input for b4a

Rusty

Well-Known Member
Licensed User
Longtime User
I would like to create a masked input for android. If a character is keyed into an edittext field that is not allowed, I would like to remove it from the edittext display. Typically, I'd do this with a keydown type function and then consume the keystroke instead of allowing it to make it into the edittext textbox. Any suggestions?
 

Rusty

Well-Known Member
Licensed User
Longtime User
I did this, but when you change the value within the edittext, it triggers a text changed event again. This tends to cause some recursive code and causes the system to crash. Any recommendations appreciated.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks, Erel. I had moved the testing of the values against the mask into the activity_keypress method. Basically, if there is a mask for the field being edited, it calls the testing routine, if there is no mask, then it passes the keystroke through.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…