-1

We have a Barcode scanner, to scan 3 types of barcodes (CODE93, QR, Datamatrix). The scanned data from Barcode scanner gets placed in the cursor point.

For displaying only the QR code data, even if other code gets scanned into, we need to analyse the received data in the cursor point.

We have found & tried to automate click event, but weren't able to automate the same.

Can someone help us with a program to solve the same?

Prabanj
  • 1
  • 1
  • What do you mean by automate a click event? Can you please explain it more clearly? – Hitesh Gupta May 18 '19 at 22:24
  • For example, the scanned data goes into the edittext. I need to get the value from edittext at runtime. I've tried using edittext.getText().toString() but it works only after a click event like SetOnClickListener. I have to either get the value from editext dynamically or run the invisible button click event continuously? How to acheive either of them? – Prabanj May 19 '19 at 09:10

1 Answers1

0

There is a TextWatcher listener available in the sdk to get the value of an edittext whenever it's value changes. There you can get the changed value and perform any analysis needed. Automating a click event doesn't make any sense. Whatever code you have written inside onclick listener can be called anywhere else if you have put it inside a method of your own. Still if you want to know you can look into this thread Can I click a button programmatically for a predefined intent?

button.performClick()

Hitesh Gupta
  • 1,091
  • 9
  • 14