Android Question EditText Clear

shashkiranr

Active Member
Licensed User
Longtime User
Hi All,

Need to clear edittext without firing textchanged method. I wanted use
B4X:
editText.getText().clear();
. Is there a way to achieve this using javaobject or reflection method ?

Best,
SK
 

stevel05

Expert
Licensed User
Longtime User
Try this:
B4X:
Dim ETJO As JavaObject = EditText1
    ETJO.RunMethodJO("getText",Null).RunMethod("clear",Null)

It clears the text, but still fires the textchanged method.

You'll probably need to use a Global variable flag, and check it and exit the textchanged event if it's set(and unset it), then set the flag when you amend the text but don't want to process the code in the textchanged event.
 
Upvote 0
Top