BasicCoder BasicCoder - 3 months ago 30
Android Question

Android - Automatically press search button once TextView has input

I have created an app where the user can enter some text and it searches the database once the user presses the search button. I have now modified this so it works with NFC. The NFC tags stores some text (Hello World) and once the tag has been tapped on the phone the text (Hello World) is inserted into the textview. The user can then press the search button and so on.

Is it possible to automatically press the search button once text has been entered into the textbox. For Example, The user taps their phone on the NFC tag, Hello World is entered in the textbox and the search occurs automatically without the user having to press the button.

Is this possible?

Thanks

Answer Source

When user taps their phone on the NFC tag, enter Hello World in the textbox and programmatically click SearchButton using performClick().

button.performClick();