Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surfaceCreated not triggered on resume after unlock screen #43

Open
ralphgabrielle opened this issue Jul 4, 2017 · 5 comments
Open

Comments

@ralphgabrielle
Copy link

ralphgabrielle commented Jul 4, 2017

all is going well, but if you try to press the power button (lock button) surfaceCreatedis not trigerred (SurfaceHolder.Callback surfaceHolderCallback @ line 90)

so this block (@ line 195)

public void start() { if (surfaceView != null && surfaceHolderCallback != null) { //if surface already created, we can start camera if (surfaceCreated) { startCameraView(context, cameraSource, surfaceView); } else { //startCameraView will be invoke in void surfaceCreated surfaceView.getHolder().addCallback(surfaceHolderCallback); } } }

start camera view will never be called. any fix. ?

@nisrulz
Copy link
Owner

nisrulz commented Jul 4, 2017

I will have to look into this, but a dirty fix would be to restart the activity. I understand that is not what is obviously desired, but this would force the whole setup process to start again. I would, however, keep this issue open to address this in the next release.

I would, however, like to mention that I am fairly occupied at work and haven't been able to give the time this project requires from me. I am open to contributions and help. As of now, I do not have a timeline for this fix or the next release in general.

Thank you for reporting the issue anyways. I would try to fix this asap.

@ralphgabrielle
Copy link
Author

thanks for the reply, I'll try to have a better work around and post it here.

@nisrulz
Copy link
Owner

nisrulz commented Nov 4, 2017

@ralphgabrielle Can you confirm this issue still exists based on the latest release? I have tried to simulate the issue by following the steps you mentioned and I cannot reproduce it.

@ralphgabrielle
Copy link
Author

ralphgabrielle commented Nov 5, 2017 via email

@wbinarytree
Copy link

wbinarytree commented Jul 17, 2018

I meet the same problem with version 2.1.2. Any progress on this?
Edit:
I end up with this code to fix this. Now sure why.


    override fun onStart() {
        super.onStart()
        qrReader.initAndStart(camera)

    }

    override fun onResume() {
        super.onResume()
        qrReader.start()
    }
    override fun onPause() {
        super.onPause()
        qrReader.releaseAndCleanup()
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants