I have an android studio app on a zebra device with inbuilt barcode scanner. Using broadcast receiver, I am successfully intercepting and using the scanned input.
However - I cant find a way of 'dumping' the input after interception... it just seems to have to go somewhere, either into any text field it can find which might have focus, or if a button, for example , has focus, it flickers each time a character is received.
I suspect there is a way of erasing the input after interception, but I cant find it.
Has anyone had the same issue?
The code I am using is very simple but seems to work:
private final BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String code = intent.getStringExtra(DATA);
if (scantype.contains("LASER")) {
try {
process_code(code);
} catch (JSONException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};