question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello there, thanks for this great QR reader!

I wonder if its possible to restart the qreader object after call .stop() on it.

For example: On the onDetect listener, after I detect something, I show a Dialog and call qreader.stop()

qrEader = new QREader.Builder(this, surfaceView, new QRDataListener() {
            @Override public void onDetected(final String data) {
                Log.d("QREader", "Value : " + data);
                surfaceView.post(new Runnable() {
                    @Override public void run() {
                        showDialog(data);
                    }
                });
            qrEader.stop();               <------------------------------------- HERE
            }
        }).build();

        qrEader.init();

So when I dismiss my Dialog I call qreader.start() but it doens’t read the qrcode anymore

    private void showDialog(String qrcode) {
        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
        builder.setTitle("Confirmar convidado?");
        builder.setMessage(qrcode);

        String positiveText = getString(android.R.string.ok);
        builder.setPositiveButton(positiveText,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        System.out.println("OK");
                        surfaceView.post(new Runnable() {
                            @Override public void run() {
                                qrEader.start();      <------------------------- HERE
                            }
                        });

                    }
                });

        String negativeText = getString(android.R.string.cancel);
        builder.setNegativeButton(negativeText,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        System.out.println("CANCEL");

                        qrEader.start();       <-------------------------------- HERE
                    }
                });

        AlertDialog dialog = builder.create();

        dialog.show();
    }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nisrulzcommented, Sep 27, 2016

@punksta provided a fix which is merged into the develop branch and should be released soon. Closing this.

0reactions
nisrulzcommented, Jun 27, 2016

Guys, I haven’t got time to fix it lately but I will update it within this week. Meanwhile if anyone else get a change to take a dig at it , then please send a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nisrulz/qreader: [Android Library] Read QR codes ... - GitHub
Android library which makes use of Google's Mobile Vision API to enable reading QR Code. The library is built for simplicity and ease...
Read more >
Restarting the event collection service - IBM
There might be situations when you want to restart only the event collection service across all managed hosts in your IBM QRadar environment....
Read more >
Qreader | Online QR Code Reader
Scan your QR Code ; Use your camera to decode the QR Code image, Upload your QR code image file ; drag and...
Read more >
[Updated] QReader - QR Code Reader app not working (down ...
Try to restart your iPhone / iPad. Press the power off button for few seconds and then choose restart from the menu to...
Read more >
QREader (library API) - javadoc.io
Constructor Detail. QREader. public QREader(). Method Detail. start. public static void start(android.content.Context context, android.view.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found