EditText

metrick

Active Member
Licensed User
Longtime User
How do I retrieve/access edit text value on edittext?

dim edt as edittext

edt.inputtype = edt.input_type_numbers


sub edt_EnterPressed
toastmessageshow(edt.text,false) -> 'show nothing after several numbers entered.
end sub
 

joseluis

Active Member
Licensed User
Longtime User
You probably forgot to initialize the edittext:
B4X:
  dim edt as edittext
  edt.initialize("")
  edt.text = "test"
  toastmessageshow(edt.text,false)

That should work
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
This is working for me, no different to yours if you have a layout and have loaded it which is not obvious from your code.

There is a thought in the back of my mind that on a particular device, the toast message didn't show if the keyboard was on screen (or was behind it). I'm not sure what device it was.
 

Attachments

  • t1.zip
    8.4 KB · Views: 166
Upvote 0

metrick

Active Member
Licensed User
Longtime User
Thanks joseluis & stevel05
I made a booboo. I initialize edt. eg. edt.initilized("edt") in Activity_Create sub.
I still think that it should work with EditText initialized but it doesn't.
:BangHead:
 
Upvote 0
Top