Giter Site home page Giter Site logo

Comments (7)

alistairsykes avatar alistairsykes commented on September 18, 2024 1

We are yet to do a release with this fix in. We had a few other things to get done before publishing the code. I will post again on this issue once we have done that.

from kbarcode.

alistairsykes avatar alistairsykes commented on September 18, 2024

Hi @OmarJoya . Thanks for reporting this, to clarify these are your steps to recreate:

  • Be on Android 6 device
  • Open app
  • Request permission
  • Once granted call barcode.start()

Is that correct?

from kbarcode.

OmarJoya avatar OmarJoya commented on September 18, 2024

Yes, also I added the BarcodeView as an observer to the lifecycle in onActivityCreated as you have on https://github.com/brightec/KBarcode/wiki

image

from kbarcode.

alistairsykes avatar alistairsykes commented on September 18, 2024

This exception does appear to be caused by affectively calling barcodeView.start() twice, in quick succession.

I had previously thought the library handled calling start() twice, as seen in BarcodeScanner.start() where I check if the cameraSource.isStarted(). However if you call twice in quick succession, the second time the camera source does not report as starting because it is still opening the camera.

I will create a pull request soon which will address this issue.

For your case @OmarJoya, you are right that marshmallow is the differing factor. It appears that permissions dialogs behave differently between M and Q (not sure exactly for each version in between). On M the permissions dialog causes @OnLifecycleEvent(Lifecycle.Event.ON_START) to be called when it dismisses. On Q it does not.
A temporary work around while I get this pull request together, would be to do a version check before calling barcodeView.start() after the permission is granted.

from kbarcode.

alistairsykes avatar alistairsykes commented on September 18, 2024

Pull request has been approved and merged.

from kbarcode.

OmarJoya avatar OmarJoya commented on September 18, 2024

does this last merge contain the fix?, I'm now using the kbarcode version 1.0.2, but seems the problem is not solved

from kbarcode.

alistairsykes avatar alistairsykes commented on September 18, 2024

We have now done a release which includes this fix.

https://github.com/brightec/KBarcode/releases/tag/v1.0.3

from kbarcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.