Skip to content

How to Stop Scanning #2

@livijohnson

Description

@livijohnson

Hi Jaisonfdo, Thanks so much for the great code. It works very well. I'm just wondering how to go about stopping the scanner thread as soon as a barcode is detected. My user will need to input a quantity as soon as the barcode is recognized, so I need to pause the scanning.

I have resorted to launching a new activity in the onSuccess method in BarcodeScanningActivity.java, but cannot figure out how to only launch it once. When hitting the back button you find that the new activity has been launched two or three times. I am a totally noob when it comes to multi-threading, so I'm not sure how to stop all the threads when the barcode is detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions