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

I have layout in a fragment. The App is crashing with the error log NullException cannot cast to BarcosdeCapture. For activity is working fine but for fragment it is crashing #67

Closed
AhmadRehan71 opened this issue Aug 21, 2020 · 1 comment

Comments

@AhmadRehan71
Copy link

No description provided.

@larissayasin
Copy link

I had the same problem. I solved doing this:

private val barcodeCapture by lazy { activity?.supportFragmentManager?.findFragmentById(R.id.qr_code_reader) as? BarcodeCapture }

override fun onCreateView(){
....
  barcodeCapture?.setRetrieval(this@MyFragment)
}

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

No branches or pull requests

2 participants